Solved DNS Server does not match in 2 different ways

Solved issue

banderas20

Active Member
Joined
Aug 1, 2018
Messages
102
Reaction score
42
Credits
799
Hi.

I'm trying to find out which DNS I'm querying.

With dig:

Code:
;; SERVER: 127.0.0.53#53(127.0.0.53)

cat /etc/resolv.conf

nameserver 127.0.0.53

However, if I go to my settings, or I run resolvectl status , I get

172.20.18.1

Which one is correct and why am I getting 2 different results?

Thanks!

PS: I am getting DNS via DHCP.
 


cat /etc/resolv.conf

This is the old way, it is unreliable. Usually it just points to a local cache.
Are you using dhcp to get your address?
 
I'm thinking that you get two because you have both the public internet and your local network. DNS for the local network (that is to help you find my_other_computer.local) is hosted on 127.0.0.53. The other is your public DNS, per your ISP. You can change the latter.

I'm not positive...
 
is hosted on 127.0.0.53.
Anything that is on 127.x.x.x is a local loopback. Including DNS caches.
Just about all computers now have a local IP of 127.0.0.1 and 127.0.0.53.

The 127.x.x.x subnet is reserved and cannot be routed out to the internet.

The .53 address won't show up as a network device. Because its really a psuedo ( virtual )
IP setup by systemd-resolved. You can check this on your computer...

systemctl status -l systemd-resolved

This is a DNS request forwarder ( kind of like a proxy ). So why not just go out directly
and skip the proxy? The advantage to having a local forwarder, is that all interfaces no
matter which subnet they are on, can send requests through the local address.

However the 127.0.0.1 will show up as an IP address ( local loopback ) basically "myself".
 
Last edited:
This is the old way, it is unreliable. Usually it just points to a local cache.
Are you using dhcp to get your address?

Indeed. I'm using DHCP to get everything.

I'm thinking that you get two because you have both the public internet and your local network. DNS for the local network (that is to help you find my_other_computer.local) is hosted on 127.0.0.53. The other is your public DNS, per your ISP. You can change the latter.

I'm not positive...
I though something like that might be happening. What I didn't know is that there was a loopback address for DNS ending in .53.

Mistery solved, I guess.

Thanks!
 
I decided to get myself some of that there education thanks to @dos2unix. This link explains it very well:


If your question is answered, you can edit your first post, change the title by picking a new prefix, and marking it solved.
 
Where does "172.20.18.1" come from then? Isn't this a private address too?
 
Where does "172.20.18.1" come from then? Isn't this a private address too?

Not no much "private", as unroutable. Where are you seeing this?
 
Not no much "private", as unroutable. Where are you seeing this?
in the original message. i suppose it comes from whatever the service behind resolvectl does.
 resolvectl Failed to get global data: Unit dbus-org.freedesktop.resolve1.service not found.

which i don't have activated.
 
Hi.

I think 172.20.18.1 is an internal DNS provided by my company's sysadmin. Now I'm working from a cafeteria and I get another DNS.

Thanks everyone for your replies and marking the thread as solved! :)
 

Members online


Top