My workplace (primarily a Windows shop) uses a custom SLD on our local network, so if my hostname is mycomputer my FQDN will be mycomputer.companyname.local. I can generally resolve domain names from my workstation, e.g.

yarbrdav@lusr1630:~$ ping qa-server-1
PING qa-server-1.companyname.local ( 56(84) bytes of data.
64 bytes from qa-server-1.companyname.local ( icmp_seq=1 ttl=127 time=22.7 ms
64 bytes from qa-server-1.companyname.local ( icmp_seq=2 ttl=127 time=20.1 ms
64 bytes from qa-server-1.companyname.local ( icmp_seq=3 ttl=127 time=20.0 ms

however, IT has started adding additional midlevel domains to new servers, so qa-server-4 now has a FQDN of qa-server-4.qa.companyname.local.

My Windows machine can resolve qa-server-1 and qa-server-4 without any further qualification.

However on Ubuntu qa-server-4 cannot be resolved. I have to ping qa-server-4.qa in order to find the server.

I have tried disabling avahi-daemon on the advice of a co-worker but I have not noticed any difference.

My workstation is running Ubuntu 16.04

1 Answer 1


You may be interested in configuring additional search domains.

Depending on how your system is configured, it'll be one of two ways.

First Way: If your system is configured with /etc/network/interfaces

WARNING: This section assumes that you have sudo or root access, and can edit your system configuration directly without the IT team making changes as an administrator.

If your system is static-IP'd with /etc/network/interfaces then you might have something like this in that file:

auto enp7s0
iface enp7s0 inet static
       dns-search foobar.baz

If this is the case, then just add the additional subdomains to your search domains and it'll work - so you'd see something like this:

auto enp7s0
iface enp7s0 inet static
       dns-search foobar.baz qa.foobar.baz

My guess is that if you're doing static configuration, you may need to specify the additional DNS Search Domains, which are quite possibly already being handed out by static DHCP reservations under the Windows DHCP system.

That said, if your network is DHCP and not statically configured, you'll see something else, like this in /etc/network/interfaces:

auto enp7s0
iface enp7s0 inet dhcp

If this is what you see, then you need to talk to your IT people and make sure they update the Search Domains option that DHCP is capable of sending out. That way, they have all the intermediate subdomain portions populated so what you expect to happen will happen when you just try and go to a hostname directly.

You can define the search domains though if you really have to in a DHCP setup, like this:

auto enp7s0 iface enp7s0 inet dhcp dns-search foobar.baz qa.foobar.baz

Note that both of these /etc/network/interfaces approaches require you to edit the file as an administrator, and then reboot your system afterwards to apply the configuration changes properly.

Second Way: If you use Network Manager to configure your system

There's actually two cases here. In both cases, once you've changed these configurations, you need to disconnect and reconnect using Network Manager.

Case A: Your network is statically configured.

If you go into Network Manager and the "Edit Connections" option in the network manager drop down menu, and edit the ethernet connection option (you probably only have one, called "Ethernet Connection 1" or similar):

enter image description here

You'll have to add the additional search domains to that search domains box, using commas or spaces to separate the search domains. As such, you'll then be able to auto-query the 'search domains' to find the hostnames, as Windows already does.

Case B: Your network is dynamically configured.

If your network is dynamically configured, then you may want to talk to your IT team to make sure the DHCP assigned search domains are actually up to date with all the additional intermediate domain names in there.

But assuming it's just a case of not having all the search domains set up, and it's all DHCP, we'll see this kind of IPv4 settings:

enter image description here

If this is what you see, then like in the First Way section, you just need to add the additional intermediate domains (qa.foobar.baz for example) to the "Additional Search Domains" configuration option.

That said, you should probably still talk to the IT team if this is how it's configured - they aren't pushing the search domains of course and probably should be.

  • 1
    I use NetworkManager with DHCP, and for my particular case I had to add companyname.local, qa.companyname.local in order to resolve both addresses. if I just added qa.companyname.local I was able to resolve qa-server-4 but not qa-server-1. Jul 13, 2017 at 15:37

You must log in to answer this question.

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