Local (127.0.1.1) DNS resolver ignores LAN DNS server
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I've configured a computer to act as a DNS server for my LAN (following roughly this guide). My main motivation is to be able to access my computers and appliances with URLs instead of IPs.
It's working and forwarding OK, as I'm able to resolve correctly my own names:
â ~ nslookup router.casa 192.168.1.5
Server: 192.168.1.5
Address: 192.168.1.5#53
Name: router.casa
Address: 192.168.1.1
and outside ones:
â ~ nslookup google.com 192.168.1.5
Server: 192.168.1.5
Address: 192.168.1.5#53
Non-authoritative answer:
Name: google.com
Address: 172.217.28.174
(192.168.1.5
, as you probably already discovered, is the DNS server address)
I've then setup the DHCP server (a Linksys router) to hand out 192.168.1.5
as the primary DNS address, and Google ones next. That's because I'd like my devices to be able to resolve names even if the local DNS server is down. This also seems to be working, or at least is correctly reflected in any PC when I do
â ~ nmcli dev show | grep DNS
IP4.DNS[1]: 192.168.1.5
IP4.DNS[2]: 8.8.8.8
IP4.DNS[3]: 8.8.4.4
However, normal nslookup
queries (without explicit DNS address) do not work:
â ~ nslookup router.casa
Server: 127.0.1.1
Address: 127.0.1.1#53
** server can't find router.casa: NXDOMAIN
After reading many SuperUser, Unix & Linux and AskUbuntu questions, I now know that this 127.0.1.1
address is something like a local DNS cache setup by default by resolvconf
, which comes pre-configured for that in my distro (Mint). Effectively:
â ~ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
I've read many (accepted) solutions recommending some manual patches (either editing the resolv.conf base files, removing resolvconf entirely, etc.). However, I would like any guest device to be able to use the local names, and I really don't want to edit the entire LAN settings (some of the devices are not mine).
Is there any way to configure the DNS server and/or the DHCP so that I don't have to edit all PCs' and devices' settings manually?
Also, as a side question, why is this 127.0.1.1 server ignoring the first DNS address? nslookup
fails even when I use it from the DNS server:
â ~ nslookup router.casa 127.0.0.1
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: router.casa
Address: 192.168.1.1
â ~ nslookup router.casa 127.0.1.1
Server: 127.0.1.1
Address: 127.0.1.1#53
** server can't find router.casa: NXDOMAIN
More useful output:
â ~ sudo netstat -tulpn | grep 127.0.1.1
tcp 0 0 127.0.1.1:53 0.0.0.0:* ESCUCHAR 1489/dnsmasq
udp 0 0 127.0.1.1:53 0.0.0.0:* 1489/dnsmasq
networking linux-mint dns
add a comment |Â
up vote
1
down vote
favorite
I've configured a computer to act as a DNS server for my LAN (following roughly this guide). My main motivation is to be able to access my computers and appliances with URLs instead of IPs.
It's working and forwarding OK, as I'm able to resolve correctly my own names:
â ~ nslookup router.casa 192.168.1.5
Server: 192.168.1.5
Address: 192.168.1.5#53
Name: router.casa
Address: 192.168.1.1
and outside ones:
â ~ nslookup google.com 192.168.1.5
Server: 192.168.1.5
Address: 192.168.1.5#53
Non-authoritative answer:
Name: google.com
Address: 172.217.28.174
(192.168.1.5
, as you probably already discovered, is the DNS server address)
I've then setup the DHCP server (a Linksys router) to hand out 192.168.1.5
as the primary DNS address, and Google ones next. That's because I'd like my devices to be able to resolve names even if the local DNS server is down. This also seems to be working, or at least is correctly reflected in any PC when I do
â ~ nmcli dev show | grep DNS
IP4.DNS[1]: 192.168.1.5
IP4.DNS[2]: 8.8.8.8
IP4.DNS[3]: 8.8.4.4
However, normal nslookup
queries (without explicit DNS address) do not work:
â ~ nslookup router.casa
Server: 127.0.1.1
Address: 127.0.1.1#53
** server can't find router.casa: NXDOMAIN
After reading many SuperUser, Unix & Linux and AskUbuntu questions, I now know that this 127.0.1.1
address is something like a local DNS cache setup by default by resolvconf
, which comes pre-configured for that in my distro (Mint). Effectively:
â ~ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
I've read many (accepted) solutions recommending some manual patches (either editing the resolv.conf base files, removing resolvconf entirely, etc.). However, I would like any guest device to be able to use the local names, and I really don't want to edit the entire LAN settings (some of the devices are not mine).
Is there any way to configure the DNS server and/or the DHCP so that I don't have to edit all PCs' and devices' settings manually?
Also, as a side question, why is this 127.0.1.1 server ignoring the first DNS address? nslookup
fails even when I use it from the DNS server:
â ~ nslookup router.casa 127.0.0.1
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: router.casa
Address: 192.168.1.1
â ~ nslookup router.casa 127.0.1.1
Server: 127.0.1.1
Address: 127.0.1.1#53
** server can't find router.casa: NXDOMAIN
More useful output:
â ~ sudo netstat -tulpn | grep 127.0.1.1
tcp 0 0 127.0.1.1:53 0.0.0.0:* ESCUCHAR 1489/dnsmasq
udp 0 0 127.0.1.1:53 0.0.0.0:* 1489/dnsmasq
networking linux-mint dns
I'm inclined to believe this is a local configuration problem on your server. Your DNS server works is intended, as you have demonstrated. If your DHCP server hands out the DNS server address as the primary DNS server, then the client host should use that as a DNS server. The client can of course set up a local forwarding nameserver like dnsmasq that listens on address127.0.1.1
, or whatever, but in this case the client alone is responsible that this setup works.
â Johan Myréen
Dec 24 '17 at 20:45
What do you mean with "local (...) on your server". Is this a problem in theBIND
configuration?
â Laski
Dec 28 '17 at 17:16
The name server works, as you have demostrated by using192.168.1.5
as the server argument tonslookup
. You said the DHCP server also hands out this address as the primary name server address, so that's OK too. But something has put127.0.1.1
in/etc/resolv.conf
, probably a local forwarding resolver like dnsmasq? By local problem I mean this something hasn't done its job properly, as nothing seems to be listening on127.0.1.1
, or if some program is listening, it isn't forwarding requests to the proper name server.
â Johan Myréen
Dec 28 '17 at 19:39
@JohanMyréen yes, it isdnsmasq
(please see my last update to the question). So I need to reconfigurednsmasq
in every computer?
â Laski
Dec 29 '17 at 16:17
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I've configured a computer to act as a DNS server for my LAN (following roughly this guide). My main motivation is to be able to access my computers and appliances with URLs instead of IPs.
It's working and forwarding OK, as I'm able to resolve correctly my own names:
â ~ nslookup router.casa 192.168.1.5
Server: 192.168.1.5
Address: 192.168.1.5#53
Name: router.casa
Address: 192.168.1.1
and outside ones:
â ~ nslookup google.com 192.168.1.5
Server: 192.168.1.5
Address: 192.168.1.5#53
Non-authoritative answer:
Name: google.com
Address: 172.217.28.174
(192.168.1.5
, as you probably already discovered, is the DNS server address)
I've then setup the DHCP server (a Linksys router) to hand out 192.168.1.5
as the primary DNS address, and Google ones next. That's because I'd like my devices to be able to resolve names even if the local DNS server is down. This also seems to be working, or at least is correctly reflected in any PC when I do
â ~ nmcli dev show | grep DNS
IP4.DNS[1]: 192.168.1.5
IP4.DNS[2]: 8.8.8.8
IP4.DNS[3]: 8.8.4.4
However, normal nslookup
queries (without explicit DNS address) do not work:
â ~ nslookup router.casa
Server: 127.0.1.1
Address: 127.0.1.1#53
** server can't find router.casa: NXDOMAIN
After reading many SuperUser, Unix & Linux and AskUbuntu questions, I now know that this 127.0.1.1
address is something like a local DNS cache setup by default by resolvconf
, which comes pre-configured for that in my distro (Mint). Effectively:
â ~ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
I've read many (accepted) solutions recommending some manual patches (either editing the resolv.conf base files, removing resolvconf entirely, etc.). However, I would like any guest device to be able to use the local names, and I really don't want to edit the entire LAN settings (some of the devices are not mine).
Is there any way to configure the DNS server and/or the DHCP so that I don't have to edit all PCs' and devices' settings manually?
Also, as a side question, why is this 127.0.1.1 server ignoring the first DNS address? nslookup
fails even when I use it from the DNS server:
â ~ nslookup router.casa 127.0.0.1
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: router.casa
Address: 192.168.1.1
â ~ nslookup router.casa 127.0.1.1
Server: 127.0.1.1
Address: 127.0.1.1#53
** server can't find router.casa: NXDOMAIN
More useful output:
â ~ sudo netstat -tulpn | grep 127.0.1.1
tcp 0 0 127.0.1.1:53 0.0.0.0:* ESCUCHAR 1489/dnsmasq
udp 0 0 127.0.1.1:53 0.0.0.0:* 1489/dnsmasq
networking linux-mint dns
I've configured a computer to act as a DNS server for my LAN (following roughly this guide). My main motivation is to be able to access my computers and appliances with URLs instead of IPs.
It's working and forwarding OK, as I'm able to resolve correctly my own names:
â ~ nslookup router.casa 192.168.1.5
Server: 192.168.1.5
Address: 192.168.1.5#53
Name: router.casa
Address: 192.168.1.1
and outside ones:
â ~ nslookup google.com 192.168.1.5
Server: 192.168.1.5
Address: 192.168.1.5#53
Non-authoritative answer:
Name: google.com
Address: 172.217.28.174
(192.168.1.5
, as you probably already discovered, is the DNS server address)
I've then setup the DHCP server (a Linksys router) to hand out 192.168.1.5
as the primary DNS address, and Google ones next. That's because I'd like my devices to be able to resolve names even if the local DNS server is down. This also seems to be working, or at least is correctly reflected in any PC when I do
â ~ nmcli dev show | grep DNS
IP4.DNS[1]: 192.168.1.5
IP4.DNS[2]: 8.8.8.8
IP4.DNS[3]: 8.8.4.4
However, normal nslookup
queries (without explicit DNS address) do not work:
â ~ nslookup router.casa
Server: 127.0.1.1
Address: 127.0.1.1#53
** server can't find router.casa: NXDOMAIN
After reading many SuperUser, Unix & Linux and AskUbuntu questions, I now know that this 127.0.1.1
address is something like a local DNS cache setup by default by resolvconf
, which comes pre-configured for that in my distro (Mint). Effectively:
â ~ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
I've read many (accepted) solutions recommending some manual patches (either editing the resolv.conf base files, removing resolvconf entirely, etc.). However, I would like any guest device to be able to use the local names, and I really don't want to edit the entire LAN settings (some of the devices are not mine).
Is there any way to configure the DNS server and/or the DHCP so that I don't have to edit all PCs' and devices' settings manually?
Also, as a side question, why is this 127.0.1.1 server ignoring the first DNS address? nslookup
fails even when I use it from the DNS server:
â ~ nslookup router.casa 127.0.0.1
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: router.casa
Address: 192.168.1.1
â ~ nslookup router.casa 127.0.1.1
Server: 127.0.1.1
Address: 127.0.1.1#53
** server can't find router.casa: NXDOMAIN
More useful output:
â ~ sudo netstat -tulpn | grep 127.0.1.1
tcp 0 0 127.0.1.1:53 0.0.0.0:* ESCUCHAR 1489/dnsmasq
udp 0 0 127.0.1.1:53 0.0.0.0:* 1489/dnsmasq
networking linux-mint dns
edited Dec 29 '17 at 16:20
asked Dec 24 '17 at 18:41
Laski
64
64
I'm inclined to believe this is a local configuration problem on your server. Your DNS server works is intended, as you have demonstrated. If your DHCP server hands out the DNS server address as the primary DNS server, then the client host should use that as a DNS server. The client can of course set up a local forwarding nameserver like dnsmasq that listens on address127.0.1.1
, or whatever, but in this case the client alone is responsible that this setup works.
â Johan Myréen
Dec 24 '17 at 20:45
What do you mean with "local (...) on your server". Is this a problem in theBIND
configuration?
â Laski
Dec 28 '17 at 17:16
The name server works, as you have demostrated by using192.168.1.5
as the server argument tonslookup
. You said the DHCP server also hands out this address as the primary name server address, so that's OK too. But something has put127.0.1.1
in/etc/resolv.conf
, probably a local forwarding resolver like dnsmasq? By local problem I mean this something hasn't done its job properly, as nothing seems to be listening on127.0.1.1
, or if some program is listening, it isn't forwarding requests to the proper name server.
â Johan Myréen
Dec 28 '17 at 19:39
@JohanMyréen yes, it isdnsmasq
(please see my last update to the question). So I need to reconfigurednsmasq
in every computer?
â Laski
Dec 29 '17 at 16:17
add a comment |Â
I'm inclined to believe this is a local configuration problem on your server. Your DNS server works is intended, as you have demonstrated. If your DHCP server hands out the DNS server address as the primary DNS server, then the client host should use that as a DNS server. The client can of course set up a local forwarding nameserver like dnsmasq that listens on address127.0.1.1
, or whatever, but in this case the client alone is responsible that this setup works.
â Johan Myréen
Dec 24 '17 at 20:45
What do you mean with "local (...) on your server". Is this a problem in theBIND
configuration?
â Laski
Dec 28 '17 at 17:16
The name server works, as you have demostrated by using192.168.1.5
as the server argument tonslookup
. You said the DHCP server also hands out this address as the primary name server address, so that's OK too. But something has put127.0.1.1
in/etc/resolv.conf
, probably a local forwarding resolver like dnsmasq? By local problem I mean this something hasn't done its job properly, as nothing seems to be listening on127.0.1.1
, or if some program is listening, it isn't forwarding requests to the proper name server.
â Johan Myréen
Dec 28 '17 at 19:39
@JohanMyréen yes, it isdnsmasq
(please see my last update to the question). So I need to reconfigurednsmasq
in every computer?
â Laski
Dec 29 '17 at 16:17
I'm inclined to believe this is a local configuration problem on your server. Your DNS server works is intended, as you have demonstrated. If your DHCP server hands out the DNS server address as the primary DNS server, then the client host should use that as a DNS server. The client can of course set up a local forwarding nameserver like dnsmasq that listens on address
127.0.1.1
, or whatever, but in this case the client alone is responsible that this setup works.â Johan Myréen
Dec 24 '17 at 20:45
I'm inclined to believe this is a local configuration problem on your server. Your DNS server works is intended, as you have demonstrated. If your DHCP server hands out the DNS server address as the primary DNS server, then the client host should use that as a DNS server. The client can of course set up a local forwarding nameserver like dnsmasq that listens on address
127.0.1.1
, or whatever, but in this case the client alone is responsible that this setup works.â Johan Myréen
Dec 24 '17 at 20:45
What do you mean with "local (...) on your server". Is this a problem in the
BIND
configuration?â Laski
Dec 28 '17 at 17:16
What do you mean with "local (...) on your server". Is this a problem in the
BIND
configuration?â Laski
Dec 28 '17 at 17:16
The name server works, as you have demostrated by using
192.168.1.5
as the server argument to nslookup
. You said the DHCP server also hands out this address as the primary name server address, so that's OK too. But something has put 127.0.1.1
in /etc/resolv.conf
, probably a local forwarding resolver like dnsmasq? By local problem I mean this something hasn't done its job properly, as nothing seems to be listening on 127.0.1.1
, or if some program is listening, it isn't forwarding requests to the proper name server.â Johan Myréen
Dec 28 '17 at 19:39
The name server works, as you have demostrated by using
192.168.1.5
as the server argument to nslookup
. You said the DHCP server also hands out this address as the primary name server address, so that's OK too. But something has put 127.0.1.1
in /etc/resolv.conf
, probably a local forwarding resolver like dnsmasq? By local problem I mean this something hasn't done its job properly, as nothing seems to be listening on 127.0.1.1
, or if some program is listening, it isn't forwarding requests to the proper name server.â Johan Myréen
Dec 28 '17 at 19:39
@JohanMyréen yes, it is
dnsmasq
(please see my last update to the question). So I need to reconfigure dnsmasq
in every computer?â Laski
Dec 29 '17 at 16:17
@JohanMyréen yes, it is
dnsmasq
(please see my last update to the question). So I need to reconfigure dnsmasq
in every computer?â Laski
Dec 29 '17 at 16:17
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
The 127.0.1.1
entry is most likely placed there by dnsmasq
which is a local daemon for serving (and crucially caching) dns and dhcp.
It's possible to configure NetworkManager to not run dnsmasq as follows:
edit the file /etc/NetworkManager/NetworkManager.conf
and comment out the line dns=dnsmasq
by placing a #
at the beginning of the line.
sudo nano /etc/NetworkManager/NetworkManager.conf
Now restart NetworkManager:
sudo service network-manager restart
Next check that the 127.0.1.1
entry has vanished from /etc/resolv.conf
and replaced with those obtained from your router.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
The 127.0.1.1
entry is most likely placed there by dnsmasq
which is a local daemon for serving (and crucially caching) dns and dhcp.
It's possible to configure NetworkManager to not run dnsmasq as follows:
edit the file /etc/NetworkManager/NetworkManager.conf
and comment out the line dns=dnsmasq
by placing a #
at the beginning of the line.
sudo nano /etc/NetworkManager/NetworkManager.conf
Now restart NetworkManager:
sudo service network-manager restart
Next check that the 127.0.1.1
entry has vanished from /etc/resolv.conf
and replaced with those obtained from your router.
add a comment |Â
up vote
2
down vote
The 127.0.1.1
entry is most likely placed there by dnsmasq
which is a local daemon for serving (and crucially caching) dns and dhcp.
It's possible to configure NetworkManager to not run dnsmasq as follows:
edit the file /etc/NetworkManager/NetworkManager.conf
and comment out the line dns=dnsmasq
by placing a #
at the beginning of the line.
sudo nano /etc/NetworkManager/NetworkManager.conf
Now restart NetworkManager:
sudo service network-manager restart
Next check that the 127.0.1.1
entry has vanished from /etc/resolv.conf
and replaced with those obtained from your router.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
The 127.0.1.1
entry is most likely placed there by dnsmasq
which is a local daemon for serving (and crucially caching) dns and dhcp.
It's possible to configure NetworkManager to not run dnsmasq as follows:
edit the file /etc/NetworkManager/NetworkManager.conf
and comment out the line dns=dnsmasq
by placing a #
at the beginning of the line.
sudo nano /etc/NetworkManager/NetworkManager.conf
Now restart NetworkManager:
sudo service network-manager restart
Next check that the 127.0.1.1
entry has vanished from /etc/resolv.conf
and replaced with those obtained from your router.
The 127.0.1.1
entry is most likely placed there by dnsmasq
which is a local daemon for serving (and crucially caching) dns and dhcp.
It's possible to configure NetworkManager to not run dnsmasq as follows:
edit the file /etc/NetworkManager/NetworkManager.conf
and comment out the line dns=dnsmasq
by placing a #
at the beginning of the line.
sudo nano /etc/NetworkManager/NetworkManager.conf
Now restart NetworkManager:
sudo service network-manager restart
Next check that the 127.0.1.1
entry has vanished from /etc/resolv.conf
and replaced with those obtained from your router.
answered Jun 27 at 12:30
Craig
1213
1213
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412847%2flocal-127-0-1-1-dns-resolver-ignores-lan-dns-server%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
I'm inclined to believe this is a local configuration problem on your server. Your DNS server works is intended, as you have demonstrated. If your DHCP server hands out the DNS server address as the primary DNS server, then the client host should use that as a DNS server. The client can of course set up a local forwarding nameserver like dnsmasq that listens on address
127.0.1.1
, or whatever, but in this case the client alone is responsible that this setup works.â Johan Myréen
Dec 24 '17 at 20:45
What do you mean with "local (...) on your server". Is this a problem in the
BIND
configuration?â Laski
Dec 28 '17 at 17:16
The name server works, as you have demostrated by using
192.168.1.5
as the server argument tonslookup
. You said the DHCP server also hands out this address as the primary name server address, so that's OK too. But something has put127.0.1.1
in/etc/resolv.conf
, probably a local forwarding resolver like dnsmasq? By local problem I mean this something hasn't done its job properly, as nothing seems to be listening on127.0.1.1
, or if some program is listening, it isn't forwarding requests to the proper name server.â Johan Myréen
Dec 28 '17 at 19:39
@JohanMyréen yes, it is
dnsmasq
(please see my last update to the question). So I need to reconfigurednsmasq
in every computer?â Laski
Dec 29 '17 at 16:17