I am trying to find out why multiple search domains do not work with Debian 8.8.0. If you add the search domains in /etc/resolv.conf it will only work with one of them & in this case domain1.local works but domain2.local will not.
If you manually append the FQDN it works fine. This is for any and all CLI based tools: nslookup, ping, iperf, nmap, curl, wget ect. I have seen this before where Debian does not work with .local domains - and you have to remove avahi which I have already done to get the first .local domain working: domain1.local.
I have had multiple .local & other domain's working but with this version of Debian 8.8.x it is not working.
user@host:~$ uname -a Linux host 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u2 (2017-06-26) x86_64 GNU/Linux user@host:~$ cat /etc/resolv.conf nameserver 192.16.1.110 ### Standard Search domains: search domain1.local domain2.local domain3.local domain4.local search domain - domain1 automatically appends the domain1.local and works for nslookup, ping ect.
user@host:~$ ping host1 PING host1.domain1.local (192.16.1.110) 56(84) bytes of data. 64 bytes from host1.domain1.local (192.16.1.110): icmp_seq=1 ttl=118 time=63.6 ms user@host:~$ nslookup host1 Server: 192.16.1.110 Address: 192.16.1.110#53 Name: host1.domain1.local Address: 192.16.1.110 domain2 will not automatically be appended to the host (hosty) in this example. It will not find hosty with an nslookup from the dns server in /etc/resolv.fon (although it does exist). However - if you append the FQDN and run an nslookup, ping, curl,nmap,wget or any other cli based ip communication it works.
user@host:~$ nslookup hosty ;; Got SERVFAIL reply from 192.16.1.110, trying next server ;; Got SERVFAIL reply from 192.16.1.111, trying next server Server: 192.16.1.110 Address: 192.16.1.110#53 ** server can't find hosty: SERVFAIL user@host:~$ ping hosty ping: unknown host hosty If we append domain2.local on the end of the host it can ping, nslookup, or other.
ping,nslookup & curl working with fqdn
user@host:~$ ping hosty.domain2.local PING hosty.domain2.local (192.16.48.20) 56(84) bytes of data. 64 bytes from hosty.domain2.local (192.16.48.20): icmp_seq=1 ttl=119 time=63.6 ms nslookup with fqdn: user@host:~$ nslookup hosty.domain2.local Server: 192.16.1.110 Address: 192.16.1.110#53 Name: hosty.domain2.local Address: 192.16.48.20 user@host:~$ curl hosty.domain2.local curl: (7) Failed to connect to hosty.domain2.local port 80: Connection refused It is worth mentioning that I have this identical configuration on a Ubuntu 16.04 workstation working with around 7 search domains.
The new Debian 8.8.x servers have the issue with working with more than 1 search domain. I must be missing some simple additional configuration that is required for Debian that is slightly different than Ubuntu.
nslookup -debugto see the exact queries that are being tried. The key to the problem may be that you're gettingSERVFAILerrors rather thanNXDOMAIN. Also,digis generally a better debugging tool thannslookup.+searchoption todigto make it append search domains.domain1.local. It tries each domain in order: first it appendsdomain1.local, if that can't be found it appendsdomain2.local, and so on until it gets success. The server should return anNXDOMAINresponse forhosty.domain1.local, then it will try the next domain.