Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I have a newly built Fedora 20 server that I've just hooked to my network. It's a virtual server running on a VirtualBox host. Everything seems to be working but I have a problem with name resolution.

(I should say at this point that name resolution is provided by a Windows server on separate hardware that works well for every other machine on the network.)

From the command line I can resolve an external host like unix.stackexchange.com. I can quite happily resolve that and ping it, as with every other external host I've tried.

However, my local network (let's call it xyz.local) is different. The network interface on my F20 machine has DOMAIN=xyx.local in the network script (full script below). From the command line I can resolve, say, server-01, but not server-01.xyz.local.

I can resolve an alias in the short form, even though the canonical name is the long form, so, for example, ping mysql successfully resolves to its alias linux-04.xyz.local, but I can resolve neither mysql.xyz.local nor linux-04.xyz.local.

Clearly I've missed something. Can anyone suggest what?

/etc/hosts has only the standard localhost entries for

/etc/resolv.conf is as follows:

#Generated by Network Manager
search xyz.local
nameserver 192.168.xxx.xxx

My interface script is

NAME="Wired connection 1"
share|improve this question
@polym Thanks for the edit. This is a development machine on an doubly firewalled internal network. Is public knowledge of the credential information likely to be a risk, or is this just a matter of good form? –  user73426 Jun 24 '14 at 2:05
It is a risk that if someone comes in contact with packets containing these credential information, they can pinpoint it to you. –  polym Jun 24 '14 at 2:07

1 Answer 1

Part of your issue is likely due to your search path being auto-generated via NetworkManager:

search xyz.local

This line should really be this:

search xyz.local.

The period at the end is critical since that tells the DNS resolver to stop. So it won't do things like this to you:


You can confirm this by trying to resolve hostnames by manually adding a period yourself, temporarily.

$ nslookup mysql.xyz.local.

Resolving this domain wide

To resolve this you'll need to change the definition of your domain on your DHCP server so that it's serving out the domain as xyz.local..


The method used to resolve a hostname is controlled by the file /etc/nsswitch.conf. The notation NSS, stands for Name Service Switch, and you can read more about it via the man page, man nss.

Here's the line from my file that controls how hostnames get resolved:

$ grep ^hosts /etc/nsswitch.conf
hosts:      files dns mdns4_minimal

It looks to my local file, /etc/hosts, first, then queries DNS 2nd.

share|improve this answer
This is a server box so the address info is static. NSLOOKUP successfully resolved all three forms of the address (mysql, mysql.xyx.local, and mysql.xyz.local.), but ping only resolved the first (short) form. I have changed the search term in the Network Connections utility and restarted the interface and there's no change: nslookup resolves everything, ping doesn't. –  user73426 Jun 24 '14 at 2:34
Can you please post the contents of /etc/nsswitch.conf? Thanks. –  Warwick Jun 24 '14 at 4:30
@Warwick - done –  slm Jun 24 '14 at 11:28
@slm - Sorry, I wasn't clear enough. I didn't want to see YOUR /etc/nsswitch.conf. I wanted to see Mike W's /etc/nsswitch.conf. :-) Mike W, can you please post your /etc/nsswitch.conf? Thanks. –  Warwick Jun 24 '14 at 23:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.