1

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.)

1
  • Are the Windows PC and the Linux box using the same DNS server? I.e. ifconfig /all vs cat /etc/resolv.conf
    – teikjoon
    Commented Sep 17, 2015 at 1:25

1 Answer 1

0

It depends. If you are talking about a laptop,then the best solution is to have it pick up the network configuration from the local router, which is clearly currently not providing it.

But if this is, as I suspect, a pc which is not destined to be moved, then you can act locally, even if you do not intend to set up a static IP address for your machine. Edit the file /etc/resolvconf/resolv.conf.d/head, which should exist even though it is empty except for a comment, and add to it the following lines:

   domain company.local
   search company.local

When you reboot your Ubuntu pc (because of a bug in the resolvconf package, you cannot just restart your network to see the changes, you must reboot your pc), you will notice that the file /etc/resolv.conf now contains the lines

   domain company.local
   search company.local
   nameserver 127.0.0.1

or something like this. In other words, the head file is added at the beginning of your (all-important) resolv.conf file. This should fix your problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .