Difference on DNS resolving between GUI and CLI

Started by fbantgat7, April 26, 2024, 01:32:17 PM

Previous topic - Next topic
Hi All,

A particular domain, let's call it "www.example.com" which is not configured as a CNAME but has an A record, fails to resolve on the CLI:
$ host www.example.com
Host www.example.com not found: 3(NXDOMAIN)


but resolves on the ISP's resolvers when using the [Interfaces: Diagnostics: DNS Lookup] on the router's GUI.

The router's /etc/resolv.conf shows:
# cat /etc/resolv.conf
domain localdomain
nameserver 127.0.0.1
nameserver [ISP's resolver IPv4 address 1]
nameserver [ISP's resolver IPv4 address 2]
nameserver [ISP's resolver IPv6 address 1]
nameserver [ISP's resolver IPv6 address 2]
search localdomain


The PC's on the LAN also fail to resolve:
$ nslookup www.example.com 192.168.1.1
Server: 192.168.1.1
Address: 192.168.1.1#53

** server can't find www.example.com: NXDOMAIN


This does not happen with other domain names, or even with the apex "example.com", these are resolved normally.  Just to confuse matters this problem occurs sporadically.  If I run a few times 'dig +trace +short www.example.com A'  on the PC, then I can obtain an IP address both on the PC and on the router's CLI.  A day or two later caches are flushed and the problem returns.

Why does this difference between GUI and CLI happen and how can I troubleshoot it?