Page 1 of 1

Domain name

Posted: Tue Jan 24, 2012 6:13 am
by Crayon Shin Chan
Why do Unix-related OSs always want a domain name as well as a hostname? Sure they can be easily appeased with "local", but that's not the point. What should I put in there? What shouldn't I put in there? Why does the box need to know its domain name at all?

Re: Domain name

Posted: Tue Jan 24, 2012 8:31 am
by notfred
Unix-related OSs tend to follow standards and a lot of the standards want fully qualified domain names e.g. for sending email. Some other OSs (e.g. Windows) are rather more sloppy about the standards and will skip things that are inconvenient.

For choosing the domain see:
http://superuser.com/questions/117056/h ... me-network
http://serverfault.com/questions/17255/ ... orks/17566

Don't put .local (it can break mDNS) and don't make up some valid TLD (it can break if ICANN ever releases that TLD).

Re: Domain name

Posted: Tue Jan 24, 2012 8:36 am
by cheesyking
so it can communicate with other hosts on the network and vice versa using DNS rather than IP addresses etc.

You can setup your dhcp server to set the domain and/or hostname of its clients and then register them with your network's DNS server so (on a home network) bedroom.localdomain always points at your bedroom machine. If you were talking about windows boxes then they could communicate with each other with their workgroup names but nix boxes wouldn't want to have to rely on you installing samba before they could get talking so it expects you to do a basic manual setup of DNS even if you never actually use it.

To get a manual setup working you'd still have to register the hostname on your dns server somehow... or perhaps add it to each of your boxes' hosts files if you wanted to be really old skool.

Granted it isn't necessary on home networks as you can just use IPs and anyway most hosts on home networks are only talking to the internet and not to each other so they never need to do local name resolution.

Re: Domain name

Posted: Tue Jan 24, 2012 8:41 am
by cheesyking
notfred wrote:
Don't put .local (it can break mDNS) and don't make up some valid TLD (it can break if ICANN ever releases that TLD).


There have been a fair number of "the end in nigh" type stories since ICANN said they were going to start offering custom tlds. I'd imagine there are admins out there who've made some very poor decisions in the light of this.

Re: Domain name

Posted: Tue Jan 24, 2012 8:48 am
by thegleek
hostname - show or set the system's host name
dnsdomainname - show the system's DNS domain name

ie: dnsdomainname
com

ie: hostname
techreport.com

all of which is set inside /etc/hostname

Best site to explain all this junk: http://jblevins.org/notes/hostname

Re: Domain name

Posted: Tue Jan 24, 2012 8:59 am
by just brew it!
notfred wrote:
Unix-related OSs tend to follow standards and a lot of the standards want fully qualified domain names e.g. for sending email. Some other OSs (e.g. Windows) are rather more sloppy about the standards and will skip things that are inconvenient.

I would include in the "sloppy other OSes" category those UNIX-related OSes that try to be more friendly to people coming over from the Windows side, e.g. Ubuntu. :wink: