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. Commented Jun 20, 2017 at 22:49

1 Answer 1


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.

  • What is a valid way to verify if the search list works in that case? How can I just type in jira and check by attaching which domain out of my search list resolved? Commented Oct 1, 2021 at 8:26

You must log in to answer this question.

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