Diagnose DNS problem

Paul Smith paul at mad-scientist.net
Sun Oct 2 14:34:12 UTC 2022


On Sun, 2022-10-02 at 15:20 +0100, Colin Law wrote:
> On Sun, 2 Oct 2022 at 15:09, Paul Smith <paul at mad-scientist.net>
> wrote:
> > 
> > The thing to look at is the contents of the /etc/resolv.conf file
> > on the system.  That will tell you (or anyway, us :)) what type of
> > DNS setup the system uses.
> 
> Thanks for helping out.  /etc/resolv.conf contains
> 
> # This file is managed by man:systemd-resolved(8). Do not edit.

Interesting.  I didn't think systemd-resolved would be present on a
system as old as that.

> 192.168.1.254 is the router.

Then it appears that maybe your router's DNS server is wonky.

To tell you can use the "host" command; if you don't give it a DNS
server it will use the system one:

  $ host www.google.com
  www.google.com has address 142.251.35.164
  www.google.com has IPv6 address 2607:f8b0:4006:81e::2004

If you do give it a DNS server it will use that specifically:

  $ host www.google.com 192.168.1.254

Does that return something useful?

You can also try using one of the public DNS servers; for example
Google provides some very nice ones:

  $ host www.google.com 8.8.8.8
  Using domain server:
  Name: 8.8.8.8
  Address: 8.8.8.8#53
  Aliases:

  www.google.com has address 172.217.165.132
  www.google.com has IPv6 address 2607:f8b0:4006:80c::2004

Does that work?

If using 8.8.8.8 works but your router doesn't, you could try rebooting
the router.  If that doesn't work then probably the DNS server the
router is configured to use is wonky.  Are there other systems on that
same network that would use the router for DHCP (to get their IP
addresses)?  Like a phone using wifi for example?  Are these devices
able to resolve hostnames?  If so then it's probably NOT your router.

If it seems to be the router you can either reconfigure the local
system to use a different DNS server (such as 8.8.8.8 as above; there
are others out there), or you can configure the router to use a
different one if it's the upstream DNS server the router is using.




More information about the ubuntu-users mailing list