2

I noticed sometimes '.' can be seen at the end of

myhost.mydomain

so it is

myhost.mydomain.
              ^^^

statement. Where should I use this '.' at the end? Currently in etc/hosts I don't use ending '.' Also not in local-host-names, and never, I think. Where and when it is needed?

please give some links if this can't be answered directly

3 Answers3

1

The trailing dot makes this a "Fully Qualified Domain Name" or FQDN. This is an absolute reference that fully specifies the entire path of the server in the DNS hierarchy.

Think of it as being the equivalent of a full path in Linux/BSD for a filename starting from root or "/".

You would use it when you do not want the OS/programs to be able to append the local system's domain to the end of it.

YLearn
  • 1,247
  • 7
  • 17
  • should I use this option in etc/hosts? –  May 09 '13 at 22:31
  • You can do so, but may not need to do so. If you don't your system may append the local domain to the hostname in the file. For instance, using your example above, if you did a lookup for myhost.mydomain and there is a local domain of localdomain, it may try doing myhost.mydomain.localdomain (usually when the straight lookup fails). With the dot at the end, it would not try appending the localdomain. – YLearn May 09 '13 at 22:36
0

myhost.mydomain // here it is not FQDN: programs might append local system's domain to end of it

but:

myhost.mydomain. // here it is FQDN: programs can't append local system's domain to end of it
gumtree
  • 1
  • 2
0

Where and when it is needed?

as other mentioned - when you want to have FQDN. Use it in etc/hosts file

authority
  • 1
  • 2