3

When read /etc/resolv.conf:

me@alpha:~$ cat /etc/resolv.conf | tail -3                                                                                
# operation for /etc/resolv.conf.

nameserver 127.0.0.53

I got the idea of DNS from The Internet: IP Addresses & DNS - YouTube and aware that DNS is Google Public DNS - Wikipedia

How could the default namesever is a localhost address? I guess it impossible accessing to external services.

pa4080
  • 29,351
  • 10
  • 85
  • 161
Alice
  • 1,640
  • 3
  • 18
  • 36
  • Name resolution is not based on `/etc/resolv.conf` only. That file is part of a dynamic system, the details of which depend on the exact version of Ubuntu that you use. See for example [What is the proper way to change the DNS IP?](https://askubuntu.com/questions/2321/what-is-the-proper-way-to-change-the-dns-ip). Other questions on AU also refer to the same theme. – Marc Vanhoomissen Jan 18 '19 at 09:02

1 Answers1

7

In recent Ubuntu releases, domain name resolution is handled by systemd-resolvd, and 127.0.0.53 is only a stub listener created by systemd-resolvd. You can find out the actual DNS server that handles DNS queries by the command

$ systemd-resolve --status

Looks for the line that starts with DNS Servers.

You can learn more about systemd-resolvd from its manpage.

Anthony Wong
  • 891
  • 6
  • 20