Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer
    
should I use this option in etc/hosts? –  AB_ May 9 '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 9 '13 at 22:36

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
share|improve this answer

Where and when it is needed?

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

share|improve this answer
    
yes, I know.... –  AB_ May 10 '13 at 15:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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