I have trouble getting DNS suffix to work properly

Basically, I have jira.mycompany.local in the company DNS server mapped to

I want to be able to access it using both jira and jira.mycompany.local.

I have this in my /etc/systemd/resolvd.conf

Domains=mycompany.local devnet.mycompany.nl

Restarting the Network manager & resolved:

systemctl restart NetworkManager.service
systemctl restart systemd-resolved.service 

Results in this /etc/resolv.conf:


search mycompany.local
search devnet.mycompany.nl

So this all looks good. Testing the DNS:

nslookup jira.mycompany.local

Name:   jira.mycompany.local

Ping to IP:

PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=63 time=7.04 ms

Ping To hostname (with and without suffix):

>ping jira
ping: jira: Name or service not known

>ping jira.mycompany.local
ping: jira.mycompany.local: Name or service not known

Relevant line of /etc/nsswitch.conf:

hosts:          files [NOTFOUND=return] resolve [!UNAVAIL=return] dns myhostname

(I removed the avahi line so it won't interfere.)

Test using dig:

dig +short jira 

dig +short jira.mycompany.local


I modified the hosts line in the etc/nsswitch.conf:

hosts:          files resolve dns


>ping jira.mycompany.local
PING jira.mycompany.local ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=63 time=7.04 ms

Works, but:

>ping jira
ping: jira: Temporary failure in name resolution

How can I debug this issue / or fix it?

  • When you use dig to diagnose DNS problems, always explicitely specify the nameserver you query with the @ option. You have 3 nameservers, test each of them separately. – Patrick Mevzek Jun 20 '17 at 22:49

Try using only on search line in you resolv.conf

search mycompany.local devnet.mycompany.nl

Secondly, your test with dig using only jira fails and that is a normal behavior! dig won't auto-complete your hostname with the domains specified in resolv.conf.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.