6

I have some Debian desktop machines, and during installation I left the domain name field blank, because I don't host any websites and I do not have a static IP (whatsmyip.org gives a different IP every few months).

What should the domain name be in this situation?

3

You have several choices.

You can use the .local domain name, which is reserved for machines that are not accessible from the Internet. (You can use it on a machine that can make outgoing connections to the Internet, or even from a machine that can but normally doesn't receive incoming connections from the Internet.) This name is reserved for that use, it will never be used by a machine on the Internet.

Another similar, more common but not officially-sanctioned name is .localdomain. It is preferable as some systems only support .local for names discovered by mDNS (Linux doesn't care but OSX does, thanks roima).

Alternatively, you can use a name that you pick, that isn't in use as a TLD. This has the advantage that you can use different names for different private networks.

Alternatively, you can use names under a public TLD, even if the machine isn't reachable from the Internet. This can be confusing if these names aren't recorded in the domain name system however.

For a single machine, having a domain name recorded is pretty much useless. The domain name setting is not used much. Its most common use is as a default zone to search for host names, as a default for the domain or search setting in /etc/resolv.conf, i.e. when you access the host foo, the application will try foo.localdomain or whatever you've picked.

Setting a domain name is useful when you have multiple machines on your local network — either physical or virtual machines. If you have multiple machines, you'll probably want to set up a local name server (which doesn't require using a domain name, you can stick to dot-less host names).

Setting a distinctive domain name is useful when some of your computers have variable network connectivity, e.g. a laptop, or a computer where you sometimes use a VPN. You can then use the domain name as an indication of which network you're currently connected to.

  • Don't use ".local"; it's reserved for Zeroconf names, and some systems (particularly Macs) will not resolve it except by multicast DNS. – roaima Mar 15 '15 at 23:04
0

Domain name or host name?

The full hostname is the local machine name prepended to a domain like host.example.com. (I am fuzzing over some details, but close enough.)

So, the two questions are what to name the host, and what to name the domain.

Idealy the full hostname should be globally unique. (Again there are some esoteric exceptions.) The way we accomplish this is register a domain (or subdomain) and assign hostnames within that domain. The hostnames probably should help you remember which computer is which. The easiest way to get a subdomain is to just pick one for a domain you own. If you do not have any domains registered, you can either register one or squat. For years I squatted on hildred.pri. Squatting has risks, namely that there is the chance the name may become valid.

-1

It can be whatever you want. Some people chose to name multiple servers following themes, such as characters/locations from your favourite movie/book/game. Otherwise more logical naming might be useful; if it's your personal dev box you might just want to call it dev-01 and your next dev-02 and so on. It's essentially just for your convenience.

  • 2
    This was about the domain name, not the host name. – Mikel Mar 15 '15 at 22:31
  • 1
    Sorry, it's late, completely misread the question. – JamoBox Mar 15 '15 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.