resolv.conf questions
Chris Green
cl at isbd.net
Thu Aug 8 08:05:18 UTC 2019
On Wed, Aug 07, 2019 at 07:54:59PM +0800, Eliza wrote:
> Sorry I was still confused.
> When I put the line into /etc/resolv.conf:
>
> nameserver 8.8.8.8
>
> after a while it was replaced by the default one:
>
> nameserver 127.0.0.53
>
The 127.0.0.53 nameserver address is the *internal* (to the machine)
caching nameserver. It remembers IP addresses for names and thus
saves sending a request out to the external nameserver[s] every time
you use a name. The cache expires at intervals so that if an IP is
changed you will get the new address (after a while).
> How can I enforce to use 8.8.8.8 as nameserver?
>
8.8.8.8 is an *external* nameserver, the DNS lookup system on your
computer should go there (if 8.8.8.8 is the one you choose to use)
when it can't find a Name/IP pair in its internal cache.
Depending on your OS (yes, I know it's some sort of Ubuntu, but it may
still be different between versions) there are various ways that your
system may have the external nameserver configured.
The *usual* way this is done is in your ISP supplied router, it will usually
supply its IP (the router's IP that is) as the DNS your computers on
your LAN will use. This is often 198.168.1.1 but certainly not
always. The router will cache Name/IP pairs (in addition to the cache
in your computer]s]) and it will pass requests for which it doesn't
have the name in its cache to an external DNS which will (usually
again) be your ISP's nameserver[s].
Thus if you want to change to using Google's nameservers at 8.8.8.8
the best/usual/right way to do it is probably to set the DNS in your
router.
As you can see DNS is quite complex and, while the above is the
commonest set-up it's by no means the only way of doing it.
--
Chris Green
More information about the ubuntu-users
mailing list