Ubuntu 18.04 .local domain dns lookup not working











up vote
0
down vote

favorite
1












I'm using a Raspberry Pi 3 with Ubuntu 18.04. At my company we have a DNS server and a couple of domains with ".local".
I know technically this isn't correct and it should be ".lan" instead, because .local is reserved for multicast dns. But that's the way it is and it can't easily be changed. So on my windows machine I can ping and browse to those domain names without trouble. On my Ubuntu however I can not.



I can not use IPs because some domains are on the same machine and the IIS webserver sorts things out what goes where.



I have searched and it comes up quite often:




  • https://smallbusiness.chron.com/resolving-local-ubuntu-38861.html

  • Why do none of my local servers resolve?

  • ubuntu server not resolving LAN hostnames


However changing /etc/nsswitch.conf doesn't do the trick for me.
I tried




  • hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname # default

  • hosts: files dns

  • hosts: files mdns4_minimal [NOTFOUND=continue] dns myhostname

  • hosts: files mdns4 [NOTFOUND=return] dns myhostname

  • hosts: files mdns4 [NOTFOUND=continue] dns myhostname

  • hosts: files dns mdsn4_minimal myhostname

  • hosts: dns

  • a few others


None of which worked. I tried rebooting after a change too.
I tried to tell avahi that the domain-name=alocal in /etc/avahi/avahi-daemon.conf, didn't work after service restart, didn't work after reboot.
After this not working, I tried disabling the avahi-daemon service entirely.



sudo systemctl disable avahi-daemon


After a reboot I tried a couple of permutations in /etc/nsswitch.conf again, with no effect.



with my current settings in hosts (files dns) I get this response:



dig login.name.local # not the actual name

; <<>> Dig 9.11.3-1ubuntu1.1-Ubuntu <<>> login.name.local
;; global options: +cmd
;; Got answer:
;; WARNING .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33538
;; flags: qr rd ra; QUERY: 1, ANSWER:0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;login.name.local. 0 IN A

;; Query time: 2msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Thu Aug 23 10:51:50 CEST 2018
;; MSG SIZE rcvd: 56


However when I instruct dig to query the server directly I get the correct answer:



dig @dnsIP login.name.local
; <<>> Dig 9.11.3-1ubuntu1.1-Ubuntu <<>> login.name.local
; (1 server found)
;; global options: +cmd
;; Got answer:
;; WARNING .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57866
;; flags: qr aa rd ra; QUERY: 1, ANSWER:1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;login.name.local. 0 IN A

;; ANSWER SECTION:
login.name.local. 3600 IN A serverIP

;; Query time: 2msec
;; SERVER: dnsIP#53(dnsIP)
;; WHEN: Thu Aug 23 10:51:50 CEST 2018
;; MSG SIZE rcvd: 56


This version of Ubuntu uses netplan with the network manager.
The correct DNS IP is definitely in the list. (in fact it's the primary DNS.)
Also the dnsIp is the same as serverIP, but that shouldn't be an issue.



Ping or connecting via browser and such don't work of course. None use the dns query.



I'm at a loss at what to do. Certainly we can't switch to a different domain name.
I put the servername into /etc/hosts but that's just a temporary solution.










share|improve this question
























  • changing the resolv.conf as jeremfg suggested worked for me after chasing my tail around this for several hours. Tnx.
    – user3529828
    Nov 30 at 20:33















up vote
0
down vote

favorite
1












I'm using a Raspberry Pi 3 with Ubuntu 18.04. At my company we have a DNS server and a couple of domains with ".local".
I know technically this isn't correct and it should be ".lan" instead, because .local is reserved for multicast dns. But that's the way it is and it can't easily be changed. So on my windows machine I can ping and browse to those domain names without trouble. On my Ubuntu however I can not.



I can not use IPs because some domains are on the same machine and the IIS webserver sorts things out what goes where.



I have searched and it comes up quite often:




  • https://smallbusiness.chron.com/resolving-local-ubuntu-38861.html

  • Why do none of my local servers resolve?

  • ubuntu server not resolving LAN hostnames


However changing /etc/nsswitch.conf doesn't do the trick for me.
I tried




  • hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname # default

  • hosts: files dns

  • hosts: files mdns4_minimal [NOTFOUND=continue] dns myhostname

  • hosts: files mdns4 [NOTFOUND=return] dns myhostname

  • hosts: files mdns4 [NOTFOUND=continue] dns myhostname

  • hosts: files dns mdsn4_minimal myhostname

  • hosts: dns

  • a few others


None of which worked. I tried rebooting after a change too.
I tried to tell avahi that the domain-name=alocal in /etc/avahi/avahi-daemon.conf, didn't work after service restart, didn't work after reboot.
After this not working, I tried disabling the avahi-daemon service entirely.



sudo systemctl disable avahi-daemon


After a reboot I tried a couple of permutations in /etc/nsswitch.conf again, with no effect.



with my current settings in hosts (files dns) I get this response:



dig login.name.local # not the actual name

; <<>> Dig 9.11.3-1ubuntu1.1-Ubuntu <<>> login.name.local
;; global options: +cmd
;; Got answer:
;; WARNING .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33538
;; flags: qr rd ra; QUERY: 1, ANSWER:0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;login.name.local. 0 IN A

;; Query time: 2msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Thu Aug 23 10:51:50 CEST 2018
;; MSG SIZE rcvd: 56


However when I instruct dig to query the server directly I get the correct answer:



dig @dnsIP login.name.local
; <<>> Dig 9.11.3-1ubuntu1.1-Ubuntu <<>> login.name.local
; (1 server found)
;; global options: +cmd
;; Got answer:
;; WARNING .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57866
;; flags: qr aa rd ra; QUERY: 1, ANSWER:1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;login.name.local. 0 IN A

;; ANSWER SECTION:
login.name.local. 3600 IN A serverIP

;; Query time: 2msec
;; SERVER: dnsIP#53(dnsIP)
;; WHEN: Thu Aug 23 10:51:50 CEST 2018
;; MSG SIZE rcvd: 56


This version of Ubuntu uses netplan with the network manager.
The correct DNS IP is definitely in the list. (in fact it's the primary DNS.)
Also the dnsIp is the same as serverIP, but that shouldn't be an issue.



Ping or connecting via browser and such don't work of course. None use the dns query.



I'm at a loss at what to do. Certainly we can't switch to a different domain name.
I put the servername into /etc/hosts but that's just a temporary solution.










share|improve this question
























  • changing the resolv.conf as jeremfg suggested worked for me after chasing my tail around this for several hours. Tnx.
    – user3529828
    Nov 30 at 20:33













up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





I'm using a Raspberry Pi 3 with Ubuntu 18.04. At my company we have a DNS server and a couple of domains with ".local".
I know technically this isn't correct and it should be ".lan" instead, because .local is reserved for multicast dns. But that's the way it is and it can't easily be changed. So on my windows machine I can ping and browse to those domain names without trouble. On my Ubuntu however I can not.



I can not use IPs because some domains are on the same machine and the IIS webserver sorts things out what goes where.



I have searched and it comes up quite often:




  • https://smallbusiness.chron.com/resolving-local-ubuntu-38861.html

  • Why do none of my local servers resolve?

  • ubuntu server not resolving LAN hostnames


However changing /etc/nsswitch.conf doesn't do the trick for me.
I tried




  • hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname # default

  • hosts: files dns

  • hosts: files mdns4_minimal [NOTFOUND=continue] dns myhostname

  • hosts: files mdns4 [NOTFOUND=return] dns myhostname

  • hosts: files mdns4 [NOTFOUND=continue] dns myhostname

  • hosts: files dns mdsn4_minimal myhostname

  • hosts: dns

  • a few others


None of which worked. I tried rebooting after a change too.
I tried to tell avahi that the domain-name=alocal in /etc/avahi/avahi-daemon.conf, didn't work after service restart, didn't work after reboot.
After this not working, I tried disabling the avahi-daemon service entirely.



sudo systemctl disable avahi-daemon


After a reboot I tried a couple of permutations in /etc/nsswitch.conf again, with no effect.



with my current settings in hosts (files dns) I get this response:



dig login.name.local # not the actual name

; <<>> Dig 9.11.3-1ubuntu1.1-Ubuntu <<>> login.name.local
;; global options: +cmd
;; Got answer:
;; WARNING .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33538
;; flags: qr rd ra; QUERY: 1, ANSWER:0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;login.name.local. 0 IN A

;; Query time: 2msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Thu Aug 23 10:51:50 CEST 2018
;; MSG SIZE rcvd: 56


However when I instruct dig to query the server directly I get the correct answer:



dig @dnsIP login.name.local
; <<>> Dig 9.11.3-1ubuntu1.1-Ubuntu <<>> login.name.local
; (1 server found)
;; global options: +cmd
;; Got answer:
;; WARNING .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57866
;; flags: qr aa rd ra; QUERY: 1, ANSWER:1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;login.name.local. 0 IN A

;; ANSWER SECTION:
login.name.local. 3600 IN A serverIP

;; Query time: 2msec
;; SERVER: dnsIP#53(dnsIP)
;; WHEN: Thu Aug 23 10:51:50 CEST 2018
;; MSG SIZE rcvd: 56


This version of Ubuntu uses netplan with the network manager.
The correct DNS IP is definitely in the list. (in fact it's the primary DNS.)
Also the dnsIp is the same as serverIP, but that shouldn't be an issue.



Ping or connecting via browser and such don't work of course. None use the dns query.



I'm at a loss at what to do. Certainly we can't switch to a different domain name.
I put the servername into /etc/hosts but that's just a temporary solution.










share|improve this question















I'm using a Raspberry Pi 3 with Ubuntu 18.04. At my company we have a DNS server and a couple of domains with ".local".
I know technically this isn't correct and it should be ".lan" instead, because .local is reserved for multicast dns. But that's the way it is and it can't easily be changed. So on my windows machine I can ping and browse to those domain names without trouble. On my Ubuntu however I can not.



I can not use IPs because some domains are on the same machine and the IIS webserver sorts things out what goes where.



I have searched and it comes up quite often:




  • https://smallbusiness.chron.com/resolving-local-ubuntu-38861.html

  • Why do none of my local servers resolve?

  • ubuntu server not resolving LAN hostnames


However changing /etc/nsswitch.conf doesn't do the trick for me.
I tried




  • hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname # default

  • hosts: files dns

  • hosts: files mdns4_minimal [NOTFOUND=continue] dns myhostname

  • hosts: files mdns4 [NOTFOUND=return] dns myhostname

  • hosts: files mdns4 [NOTFOUND=continue] dns myhostname

  • hosts: files dns mdsn4_minimal myhostname

  • hosts: dns

  • a few others


None of which worked. I tried rebooting after a change too.
I tried to tell avahi that the domain-name=alocal in /etc/avahi/avahi-daemon.conf, didn't work after service restart, didn't work after reboot.
After this not working, I tried disabling the avahi-daemon service entirely.



sudo systemctl disable avahi-daemon


After a reboot I tried a couple of permutations in /etc/nsswitch.conf again, with no effect.



with my current settings in hosts (files dns) I get this response:



dig login.name.local # not the actual name

; <<>> Dig 9.11.3-1ubuntu1.1-Ubuntu <<>> login.name.local
;; global options: +cmd
;; Got answer:
;; WARNING .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33538
;; flags: qr rd ra; QUERY: 1, ANSWER:0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;login.name.local. 0 IN A

;; Query time: 2msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Thu Aug 23 10:51:50 CEST 2018
;; MSG SIZE rcvd: 56


However when I instruct dig to query the server directly I get the correct answer:



dig @dnsIP login.name.local
; <<>> Dig 9.11.3-1ubuntu1.1-Ubuntu <<>> login.name.local
; (1 server found)
;; global options: +cmd
;; Got answer:
;; WARNING .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57866
;; flags: qr aa rd ra; QUERY: 1, ANSWER:1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;login.name.local. 0 IN A

;; ANSWER SECTION:
login.name.local. 3600 IN A serverIP

;; Query time: 2msec
;; SERVER: dnsIP#53(dnsIP)
;; WHEN: Thu Aug 23 10:51:50 CEST 2018
;; MSG SIZE rcvd: 56


This version of Ubuntu uses netplan with the network manager.
The correct DNS IP is definitely in the list. (in fact it's the primary DNS.)
Also the dnsIp is the same as serverIP, but that shouldn't be an issue.



Ping or connecting via browser and such don't work of course. None use the dns query.



I'm at a loss at what to do. Certainly we can't switch to a different domain name.
I put the servername into /etc/hosts but that's just a temporary solution.







networking 18.04 dns domain-server






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 23 at 13:41

























asked Aug 23 at 9:26









FalcoGer

1017




1017












  • changing the resolv.conf as jeremfg suggested worked for me after chasing my tail around this for several hours. Tnx.
    – user3529828
    Nov 30 at 20:33


















  • changing the resolv.conf as jeremfg suggested worked for me after chasing my tail around this for several hours. Tnx.
    – user3529828
    Nov 30 at 20:33
















changing the resolv.conf as jeremfg suggested worked for me after chasing my tail around this for several hours. Tnx.
– user3529828
Nov 30 at 20:33




changing the resolv.conf as jeremfg suggested worked for me after chasing my tail around this for several hours. Tnx.
– user3529828
Nov 30 at 20:33










2 Answers
2






active

oldest

votes

















up vote
0
down vote



accepted










I faced a very similar issue (if not exactly the same) on Linux Mint 19 (Tara). I've managed to solve it by combining 3 different pieces of information.
It seems to all be related to recent changes with systemd-resolved.



First, yes I've needed to configure /etc/nsswitch.conf as you did and would expect. As long as dns comes before mdns you should be good. I ended with simply:



hosts:          files dns myhostname


ref: https://unix.stackexchange.com/a/457172/271210



Prior to upgrading to this version of Mint, this is the only thing I needed to do. Now I also ended up making the below two other changes to get it working...





After that I've configured my search domain so systemd-resolved would work as I wanted. So I've edited the file /etc/systemd/resolved.conf, the Domains setting under the [resolve] section. In my case it ended up looking like:



[Resolve]
#DNS=
#FallbackDNS=
Domains=trilliant.local
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#Cache=yes
#DNSStubListener=yes


ref: https://askubuntu.com/a/1031271/872881



I've also changed the avahi configuration to something else ("mdns" if I remember correctly, but it doesn't matter). It shouldn't be required however from my understanding. Just adding for completeness.





But none of it worked until I've called the following:



sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf


ref: https://askubuntu.com/a/938703/872881



After calling this, everything started working perfectly and as expected!



So it's possible I didn't really need to change the /etc/systemd/resolved.conf file but I kept this change since it made sense and allows me to only type a machine's name, without the complete FQDN, for DNS resolution to work.






share|improve this answer





















  • this did it. thank you very much.
    – FalcoGer
    Nov 29 at 8:06


















up vote
1
down vote













For me working way for Ubuntu 18.04 is:



Edit avahi conf:



sudo vim /etc/avahi/avahi-daemon.conf


and change .local to .alocal :



[server]
domain-name=.alocal


then, open resolved.conf:



sudo vim /etc/systemd/resolved.conf


and uncomment and edit Domains:



[Resolve]
...
Domains=yourdomain.local
...


and finally restart services:



sudo service systemd-resolved restart
sudo service avahi-daemon restart





share|improve this answer





















  • In my case I only needed to change Domains in /etc/systemd/resolved.conf (and restart the service).
    – tokosh
    Nov 12 at 1:55










  • This didn't do it for me. still nothing
    – FalcoGer
    Nov 27 at 13:14











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1068131%2fubuntu-18-04-local-domain-dns-lookup-not-working%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote



accepted










I faced a very similar issue (if not exactly the same) on Linux Mint 19 (Tara). I've managed to solve it by combining 3 different pieces of information.
It seems to all be related to recent changes with systemd-resolved.



First, yes I've needed to configure /etc/nsswitch.conf as you did and would expect. As long as dns comes before mdns you should be good. I ended with simply:



hosts:          files dns myhostname


ref: https://unix.stackexchange.com/a/457172/271210



Prior to upgrading to this version of Mint, this is the only thing I needed to do. Now I also ended up making the below two other changes to get it working...





After that I've configured my search domain so systemd-resolved would work as I wanted. So I've edited the file /etc/systemd/resolved.conf, the Domains setting under the [resolve] section. In my case it ended up looking like:



[Resolve]
#DNS=
#FallbackDNS=
Domains=trilliant.local
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#Cache=yes
#DNSStubListener=yes


ref: https://askubuntu.com/a/1031271/872881



I've also changed the avahi configuration to something else ("mdns" if I remember correctly, but it doesn't matter). It shouldn't be required however from my understanding. Just adding for completeness.





But none of it worked until I've called the following:



sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf


ref: https://askubuntu.com/a/938703/872881



After calling this, everything started working perfectly and as expected!



So it's possible I didn't really need to change the /etc/systemd/resolved.conf file but I kept this change since it made sense and allows me to only type a machine's name, without the complete FQDN, for DNS resolution to work.






share|improve this answer





















  • this did it. thank you very much.
    – FalcoGer
    Nov 29 at 8:06















up vote
0
down vote



accepted










I faced a very similar issue (if not exactly the same) on Linux Mint 19 (Tara). I've managed to solve it by combining 3 different pieces of information.
It seems to all be related to recent changes with systemd-resolved.



First, yes I've needed to configure /etc/nsswitch.conf as you did and would expect. As long as dns comes before mdns you should be good. I ended with simply:



hosts:          files dns myhostname


ref: https://unix.stackexchange.com/a/457172/271210



Prior to upgrading to this version of Mint, this is the only thing I needed to do. Now I also ended up making the below two other changes to get it working...





After that I've configured my search domain so systemd-resolved would work as I wanted. So I've edited the file /etc/systemd/resolved.conf, the Domains setting under the [resolve] section. In my case it ended up looking like:



[Resolve]
#DNS=
#FallbackDNS=
Domains=trilliant.local
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#Cache=yes
#DNSStubListener=yes


ref: https://askubuntu.com/a/1031271/872881



I've also changed the avahi configuration to something else ("mdns" if I remember correctly, but it doesn't matter). It shouldn't be required however from my understanding. Just adding for completeness.





But none of it worked until I've called the following:



sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf


ref: https://askubuntu.com/a/938703/872881



After calling this, everything started working perfectly and as expected!



So it's possible I didn't really need to change the /etc/systemd/resolved.conf file but I kept this change since it made sense and allows me to only type a machine's name, without the complete FQDN, for DNS resolution to work.






share|improve this answer





















  • this did it. thank you very much.
    – FalcoGer
    Nov 29 at 8:06













up vote
0
down vote



accepted







up vote
0
down vote



accepted






I faced a very similar issue (if not exactly the same) on Linux Mint 19 (Tara). I've managed to solve it by combining 3 different pieces of information.
It seems to all be related to recent changes with systemd-resolved.



First, yes I've needed to configure /etc/nsswitch.conf as you did and would expect. As long as dns comes before mdns you should be good. I ended with simply:



hosts:          files dns myhostname


ref: https://unix.stackexchange.com/a/457172/271210



Prior to upgrading to this version of Mint, this is the only thing I needed to do. Now I also ended up making the below two other changes to get it working...





After that I've configured my search domain so systemd-resolved would work as I wanted. So I've edited the file /etc/systemd/resolved.conf, the Domains setting under the [resolve] section. In my case it ended up looking like:



[Resolve]
#DNS=
#FallbackDNS=
Domains=trilliant.local
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#Cache=yes
#DNSStubListener=yes


ref: https://askubuntu.com/a/1031271/872881



I've also changed the avahi configuration to something else ("mdns" if I remember correctly, but it doesn't matter). It shouldn't be required however from my understanding. Just adding for completeness.





But none of it worked until I've called the following:



sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf


ref: https://askubuntu.com/a/938703/872881



After calling this, everything started working perfectly and as expected!



So it's possible I didn't really need to change the /etc/systemd/resolved.conf file but I kept this change since it made sense and allows me to only type a machine's name, without the complete FQDN, for DNS resolution to work.






share|improve this answer












I faced a very similar issue (if not exactly the same) on Linux Mint 19 (Tara). I've managed to solve it by combining 3 different pieces of information.
It seems to all be related to recent changes with systemd-resolved.



First, yes I've needed to configure /etc/nsswitch.conf as you did and would expect. As long as dns comes before mdns you should be good. I ended with simply:



hosts:          files dns myhostname


ref: https://unix.stackexchange.com/a/457172/271210



Prior to upgrading to this version of Mint, this is the only thing I needed to do. Now I also ended up making the below two other changes to get it working...





After that I've configured my search domain so systemd-resolved would work as I wanted. So I've edited the file /etc/systemd/resolved.conf, the Domains setting under the [resolve] section. In my case it ended up looking like:



[Resolve]
#DNS=
#FallbackDNS=
Domains=trilliant.local
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#Cache=yes
#DNSStubListener=yes


ref: https://askubuntu.com/a/1031271/872881



I've also changed the avahi configuration to something else ("mdns" if I remember correctly, but it doesn't matter). It shouldn't be required however from my understanding. Just adding for completeness.





But none of it worked until I've called the following:



sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf


ref: https://askubuntu.com/a/938703/872881



After calling this, everything started working perfectly and as expected!



So it's possible I didn't really need to change the /etc/systemd/resolved.conf file but I kept this change since it made sense and allows me to only type a machine's name, without the complete FQDN, for DNS resolution to work.







share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 19 at 1:35









jeremfg

161




161












  • this did it. thank you very much.
    – FalcoGer
    Nov 29 at 8:06


















  • this did it. thank you very much.
    – FalcoGer
    Nov 29 at 8:06
















this did it. thank you very much.
– FalcoGer
Nov 29 at 8:06




this did it. thank you very much.
– FalcoGer
Nov 29 at 8:06












up vote
1
down vote













For me working way for Ubuntu 18.04 is:



Edit avahi conf:



sudo vim /etc/avahi/avahi-daemon.conf


and change .local to .alocal :



[server]
domain-name=.alocal


then, open resolved.conf:



sudo vim /etc/systemd/resolved.conf


and uncomment and edit Domains:



[Resolve]
...
Domains=yourdomain.local
...


and finally restart services:



sudo service systemd-resolved restart
sudo service avahi-daemon restart





share|improve this answer





















  • In my case I only needed to change Domains in /etc/systemd/resolved.conf (and restart the service).
    – tokosh
    Nov 12 at 1:55










  • This didn't do it for me. still nothing
    – FalcoGer
    Nov 27 at 13:14















up vote
1
down vote













For me working way for Ubuntu 18.04 is:



Edit avahi conf:



sudo vim /etc/avahi/avahi-daemon.conf


and change .local to .alocal :



[server]
domain-name=.alocal


then, open resolved.conf:



sudo vim /etc/systemd/resolved.conf


and uncomment and edit Domains:



[Resolve]
...
Domains=yourdomain.local
...


and finally restart services:



sudo service systemd-resolved restart
sudo service avahi-daemon restart





share|improve this answer





















  • In my case I only needed to change Domains in /etc/systemd/resolved.conf (and restart the service).
    – tokosh
    Nov 12 at 1:55










  • This didn't do it for me. still nothing
    – FalcoGer
    Nov 27 at 13:14













up vote
1
down vote










up vote
1
down vote









For me working way for Ubuntu 18.04 is:



Edit avahi conf:



sudo vim /etc/avahi/avahi-daemon.conf


and change .local to .alocal :



[server]
domain-name=.alocal


then, open resolved.conf:



sudo vim /etc/systemd/resolved.conf


and uncomment and edit Domains:



[Resolve]
...
Domains=yourdomain.local
...


and finally restart services:



sudo service systemd-resolved restart
sudo service avahi-daemon restart





share|improve this answer












For me working way for Ubuntu 18.04 is:



Edit avahi conf:



sudo vim /etc/avahi/avahi-daemon.conf


and change .local to .alocal :



[server]
domain-name=.alocal


then, open resolved.conf:



sudo vim /etc/systemd/resolved.conf


and uncomment and edit Domains:



[Resolve]
...
Domains=yourdomain.local
...


and finally restart services:



sudo service systemd-resolved restart
sudo service avahi-daemon restart






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 6 at 15:41









Anton To

111




111












  • In my case I only needed to change Domains in /etc/systemd/resolved.conf (and restart the service).
    – tokosh
    Nov 12 at 1:55










  • This didn't do it for me. still nothing
    – FalcoGer
    Nov 27 at 13:14


















  • In my case I only needed to change Domains in /etc/systemd/resolved.conf (and restart the service).
    – tokosh
    Nov 12 at 1:55










  • This didn't do it for me. still nothing
    – FalcoGer
    Nov 27 at 13:14
















In my case I only needed to change Domains in /etc/systemd/resolved.conf (and restart the service).
– tokosh
Nov 12 at 1:55




In my case I only needed to change Domains in /etc/systemd/resolved.conf (and restart the service).
– tokosh
Nov 12 at 1:55












This didn't do it for me. still nothing
– FalcoGer
Nov 27 at 13:14




This didn't do it for me. still nothing
– FalcoGer
Nov 27 at 13:14


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1068131%2fubuntu-18-04-local-domain-dns-lookup-not-working%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How did Captain America manage to do this?

迪纳利

南乌拉尔铁路局