5

I have trouble getting DNS suffix to work properly

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

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

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

[Resolve]
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:

nameserver 192.168.10.1
nameserver 192.168.10.2
nameserver 127.0.0.53

search mycompany.local
search devnet.mycompany.nl

So this all looks good. Testing the DNS:

nslookup jira.mycompany.local
Server:     192.168.10.1
Address:    192.168.10.1#53

Name:   jira.mycompany.local
Address: 192.168.100.5

Ping to IP:

>ping 192.168.100.5
PING 192.168.100.5 (192.168.100.5) 56(84) bytes of data.
64 bytes from 192.168.100.5: 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 
(empty)

dig +short jira.mycompany.local 
192.168.100.5

[EDIT]

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

hosts:          files resolve dns

Now:

>ping jira.mycompany.local
PING jira.mycompany.local (192.168.100.5) 56(84) bytes of data.
64 bytes from 192.168.100.5: 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?

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

1 Answer 1

4

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.

1
  • 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? 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 .