0

I can't seem to find anything (Google, man pages) on what the order of the search line should be used when searching for a host against DNS with multiple levels of subdomains.

host and dig work properly and will work regardless, however when attempting to ping or ssh to a host only the first domain is searched if it is the higher level subdomain.

So the below does not work when pinging, only looking up server.internal.company.com and not server.yyz.internal.company.com

search internal.company.com yyz.internal.company.com 

however if these are swapped like below the resolution will work for both server and server.yyz

search yyz.internal.company.com internal.company.com

So my question is, is this a bug or did I miss something in documentation/RFC that specifies the order that the search domains should be in?

Nick R
  • 183
  • 1
  • 5
  • You say that it "doesn't work", what specifically happens? For instance, what result do you get with `getent ahosts foo` (foo being some non-qualified name that should resolve)? Also, just to make sure, there are no wildcards involved (that really messes with a lot of stuff, `search` included)? – Håkan Lindqvist May 02 '16 at 19:36
  • Hi, Thanks for the comments. By "doesn't work" i mean the expected resolution of the hostname does not return a result. tcpdump shows only one lookup against the higher level domain, and never the subdomain when in the faulted order. – Nick R May 04 '16 at 14:05
  • resolv.conf contains 2 lines, the dns server and the search line of `search internal.company.com yyz.internal.company.com` no wildcards. When i run `getent ahosts foo` in this configuration the result is blank, return code 2. `getent ahosts foo.yyz` will return the expected lookup result. swap the search line around so it is `search yyz.internal.company.com internal.company.com` and the getent response for `foo` and `foo.yyz` return as expected. – Nick R May 04 '16 at 14:12

0 Answers0