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?