5

A trailing dot represents that the domain is a Fully-Qualified Domain Name (FQDN). However, can a domain name in the dns search list be a FQDN?

In other words, is this proper configuration?

# /etc/resolv.conf
search domain1.com.

It seems to work, as the command host abc resolves to the IP address of abc.domain1.com.

Or, is this the correct configuration?

# /etc/resolv.conf
search domain1.com
  • 1
    Nice question! I've only ever seen sites using (no trailing period), but using a trailing period works here. – Jeff Schaller Apr 13 '18 at 18:21
  • 1
    A nice answer would skip past the ndots distraction and demonstrate how the resolver deals with trailing dots given in resolv.conf. – Jeff Schaller Apr 13 '18 at 18:30
  • So I found an rfc where it looks like domain names may have a trailing period (tools.ietf.org/html/rfc3397#section-3). Seems likely that this is valid. – Sush Apr 13 '18 at 19:21
  • 1
    Domain names indeed are specified to end in a dot; I wasn’t sure if (or which) resolvers would deal with it in resolv.conf, or if there’s a spec dictating such. – Jeff Schaller Apr 13 '18 at 19:23
  • I thought I'd read an article recently; here it is: jdebp.eu/FGA/web-fully-qualified-domain-name.html – Jeff Schaller Apr 13 '18 at 19:25
2

The concept does not apply.

Think about it. The domain and search items in /etc/resolv.conf control, for some DNS client libraries, how a non-fully-qualified domain name becomes a fully qualified domain domain name for use in the actual DNS protocol (to which the concept also does not apply). It would be infinite recursion for the qualification process to apply to itself.

Not all DNS client libraries and name qualification procedures use /etc/resolv.conf in the first place, of course. Of those that do, I am unaware of any that mind the presence or absence of a trailing dot in the search path suffixes, or where it makes any concrete difference.

You can look at this as the strings here being always fully qualified, whether a dot is present or no. But it is better to look at this as the concept of qualification not applying to one of the very mechanisms that translate non-fully-qualified names, because the idea of non-fully-qualified names exists in the layer above that mechanism.

Further reading

1

Yes, both are correct and similar.

In first you are giving an absolute domain name and in second a relative one. Its a tree like structure, each node has a text label without dots up to 63 character long. A null label of zero-length is reserved for the root. So full domain name for any node in tree would be sequence of labels on path to the root label separated by dots.

So domain names actually end with a dot i.e a separator and root's null label which is of zero-length.

Try to put one extra dot at the end other than one reaching to root, i.e search domain1.com.. , commands which use resolv.conf directly will start showing syntax error about empty label.

For eg. host , nslookup etc...

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.