How do I configure a Linux machine to pretend to be part of a domain for the purposes of DNS lookup?
The network is running on a Windows AD domain and has no special configuration (other than being joined to the domain) on the Windows side. The Windows PC automatically picks up the local suffix of company.local
(as seen in ipconfig /all
) and ping servername
and ping servername.company.local
both work as expected.
As far as I am aware the DHCP server is providing the correct domain name, although I'm not sure how to verify this explicitly.
On a Linux machine (Ubuntu 14.04) connected to the same network, also with DHCP, I can ping servername
successfully (so the DHCP and basic DNS is working) but ping servername.company.local
fails (unknown host).
Initially dnsdomainname
was blank. I tried modifying /etc/hosts
to add the domain name, and while this updated dnsdomainname
and /etc/resolv.conf
and successfully lets it ping itself+.company.local
it still doesn't work for any other addresses. I also tried setting the "Additional search domains" in the "IPv4/IPv6 Settings" tabs in the network manager UI.
Perhaps most irritatingly, when I ping servername
it says that it's pinging servername.localdomain
but then also prints 64 bytes from servername.company.local
. So some part of the system knows the suffix, but apparently not the right part.
What's the right way to get ping servername.company.local
to work on Linux machines?
(I need the FQDN to work because various files contain links using the FQDN, because this is needed when using a VPN to connect to the network externally.)
ifconfig /all
vscat /etc/resolv.conf