Solved DNS Server does not match in 2 different ways

Solved issue

banderas20

Member
Joined
Aug 1, 2018
Messages
86
Reaction score
35
Credits
651
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.
 


dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
2,106
Reaction score
1,717
Credits
15,240
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?
 

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
10,622
Reaction score
9,143
Credits
88,198
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...
 

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
2,106
Reaction score
1,717
Credits
15,240
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:
OP
B

banderas20

Member
Joined
Aug 1, 2018
Messages
86
Reaction score
35
Credits
651
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!
 

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
10,622
Reaction score
9,143
Credits
88,198
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.
 

dobeshow

Member
Joined
Jun 1, 2022
Messages
91
Reaction score
43
Credits
592
Where does "172.20.18.1" come from then? Isn't this a private address too?
 

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
2,106
Reaction score
1,717
Credits
15,240
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?
 

dobeshow

Member
Joined
Jun 1, 2022
Messages
91
Reaction score
43
Credits
592
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.
 
OP
B

banderas20

Member
Joined
Aug 1, 2018
Messages
86
Reaction score
35
Credits
651
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! :)
 
Top