I have noticed the /etc/resolv.conf shows the nameserver: 127.0.0.53
The /run/NetworkManager/resolv.conf shows the same (maybe a link)
The /run/NetworkManager/no-stub-resolv.conf shows:
nameserver: 151:236:14:64
nameserver: 62.216.95.100
nameserver:: 1
I am using the default 50-cloud-init.yaml file that has no mention of nameservers
Two questions:
where is it getting information about nameserver
what is no-stub-resolv.conf
Everything is working just after information on how it works.
Answering out of order because to understand the first you have to understand the second slightly.
What is no-stub-resolv.conf?
âstubâ refers to it pointing to the local systemd-resolved resolver instead of the direct DNS servers. Network Manager is designed to work with SystemD and ResolveD by default, so the âstub resolverâ is the local resolver in ResolveD.
The no-stub-resolv.conf if your system is not using the SystemD/ResolveD stub resolver would have to point directly to nameservers. NetworkManager would apply that to the /etc/resolv.conf or symlink it accordingly if you werenât using the SystemD stub resolvers.
Where is it getting information about nameservers?
If you use DHCP / dynamic automatically assigned IP addresses with your connections in Network Manager (whether ethernet, wifi, etc.) DHCP can assign the DNS servers for your computer to use in that network environment. Therefore, those items come from DHCP autoconfiguration. The last one of ::1 is probably from IPv6 autoconfiguration failing if your network doesnât do DHCP6 and thus is just referring to localhost. But the IPv4 nameservers get tried first.
If you use static / manually configured IP addresses in Network Manager, they are extracted from your manually configured connection data.
This is then directly passed in /etc/resolv.conf files or to the resolved components of SystemD by NetworkManager depending on whether youâre using the stub resolver (default in Ubuntu now) or not.