Strange DNS Issue on Linux

I’ve been having an odd problem with my PC, where I cannot resolve a few domains. To be clear, most domains resolve perfectly, but a few ones that should resolve don’t. For example, www.nvidia.com doesn’t resolve, although nvidia.com does.

I’ve tried it on a few other computers on the network such as my server and router, but no joy.

A few other things I’ve tried…

  • Different browsers
  • Clearing the DNS cache in those browsers (firefox and chromium)
  • Trying these different DNS servers in different orders: 192.168.1.1 (my router), 8.8.8.8, 8.8.4.4 and 1.1.1.1
  • Restarting my PC
  • Ensuring firewalld is disabled whilst testing (are there other firewalls on Arch I might be unaware of?)

Here are the contents of my resolv.conf

# Generated by resolvconf
domain localdomain
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 1.1.1.1
nameserver 192.168.1.1

Here’s what happens when I try curl-ing www.nvidia.co.uk and nvidia.co.uk

[sam@arch-anywhere]: ~>$ curl www.nvidia.co.uk
curl: (6) Could not resolve host: www.nvidia.co.uk
[sam@arch-anywhere]: ~>$ curl nvidia.co.uk
<head><body> This object may be found <a HREF="http://www.nvidia.uk/page/home.html">here</a> </body>

Like I mentioned above, I’ve verified that these problems don’t happen on other PCs on the network - its just this one.

Its got me stumped :face_with_raised_eyebrow:

Both resolve here, although oddly they point to different places (yes there are reasons for doing that). Just in case, try the following after leaving alone for an hour (which seems to be the TTL Nvidia uses) :-

for i in 8.8.8.8 8.8.4.4 1.1.1.1
do
    dig www.nvidia.co.uk @$i; dig nvidia.co.uk @$i
done

Is this from the endpoint or router? Which one is blocking what?

I’ll give the for dig command a go in a bit,

And this is from the endpoint. The PC I’m on now is the one failing to resolve. The router along with my home server have no issues resolving the address. I’m sure this has happened for other domains for a while, but I can’t recall what they were.

if you pass the -v flag to host, but leave the lookup server blank, host will show you the full dns lookup including the resolver to which your computer defaults, so

user@host:~$ host -v -t a nvidia.co.uk

and that will tell you the server that is returning NXDOMAIN an entry that should exist.

[sam@arch-anywhere]: ~>$ host -v -t a nvidia.co.uk
Trying "nvidia.co.uk"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8981
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 0

;; QUESTION SECTION:
;nvidia.co.uk.			IN	A

;; ANSWER SECTION:
nvidia.co.uk.		2598	IN	A	216.228.121.177

;; AUTHORITY SECTION:
nvidia.co.uk.		2584	IN	NS	azuredns1.nvidia.com.
nvidia.co.uk.		2584	IN	NS	azuredns2.nvidia.com.
nvidia.co.uk.		2584	IN	NS	ns5.dnsmadeeasy.com.
nvidia.co.uk.		2584	IN	NS	ns6.dnsmadeeasy.com.
nvidia.co.uk.		2584	IN	NS	ns7.dnsmadeeasy.com.

Received 170 bytes from 8.8.8.8#53 in 0 ms
[sam@arch-anywhere]: ~>$ 
[sam@arch-anywhere]: ~>$ 
[sam@arch-anywhere]: ~>$ 
[sam@arch-anywhere]: ~>$ 
[sam@arch-anywhere]: ~>$ host -v -t a www.nvidia.co.uk
Trying "www.nvidia.co.uk"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57944
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.nvidia.co.uk.		IN	A

;; ANSWER SECTION:
www.nvidia.co.uk.	2577	IN	CNAME	cs326284.adn.phicdn.net.
cs326284.adn.phicdn.net. 2577	IN	A	192.229.182.215

Received 87 bytes from 8.8.8.8#53 in 0 ms

So it looks like it is resolving now, however a curl still doesn’t work, same with browsers.

[sam@arch-anywhere]: ~>$ curl -v www.nvidia.co.uk
* Rebuilt URL to: www.nvidia.co.uk/
* Could not resolve host: www.nvidia.co.uk
* Closing connection 0
curl: (6) Could not resolve host: www.nvidia.co.uk

What happens when you run curl ‘http://www.nividia.co.uk’ Also, you could run tcpdump -vv -X -n -i eth0 port 53 while you run your curl command or browser search and see exactly where curl/the browser is querying the dns record.

Edit: single quotes around the URL are probably wrong.

Curling to nvidia.co.uk without www works

[sam@arch-anywhere]: ~>$ curl http://nvidia.co.uk
<head><body> This object may be found <a HREF="http://www.nvidia.uk/page/home.html">here</a> </body>

I’ve just tried the tcpdump as well, and it looks like that I’m getting an answer back from 8.8.8.8 for www.nvidia.co.uk

cs326284.adn.phicdn.net: type A, class IN, addr 192.229.182.215
    Name: cs326284.adn.phicdn.net
    Type: A (Host Address) (1)
    Class: IN (0x0001)
    Time to live: 1547
    Data length: 4
    Address: 192.229.182.215

So it looks like the DNS failing to resolve may be a red herring…

Edit: I tried a traceroute to 192.229.182.215, and I can reach that no problem

Just to make sure I’ve made no changes, I’ve done “iptables -S” and “nft list uleset” to see if there are any strange rules - and it all looks normal there.

I’ve double checked, and although I do have firewalld installed, its disabled and inactive

Is it possible that you have ipv6 enabled so curl is trying to use ipv6, but your dns query is only returning A records. What happens if you pass the -4 flag to curl?

If you are using pfSense you can create rules that only allow your selected DNS servers to be used. This has helped me quite a bit, it even overrides device specific DNS settings. If you go this route it will also give you a nice log in pfSense that will help with diagnosing your issue.

I don’t believe I have IPv6 enabled, I certainly haven’t gone out of my way to enable it, and the output of this would suggest its disabled (I think)

[sam@arch-anywhere]: ~>$ sudo sysctl -a | grep disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.enp0s31f6.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

I tried the curl -4 as well, and no dice

[sam@arch-anywhere]: ~>$ curl -4 www.nvidia.co.uk
curl: (6) Could not resolve host: www.nvidia.co.uk
[sam@arch-anywhere]: ~>$ curl -4 nvidia.co.uk
<head><body> This object may be found <a HREF="http://www.nvidia.uk/page/home.html">here</a> </body>

I do happen to be using pfsense, so I can look into dns overriding, as it does sound interesting.

What I don’t fully understand is that the tcpdump I took did make it look like it was doing a lookup, and getting a result back. It just looks like there’s something stopping from curl seeing it.

Blocking DNS Queries to External Resolvers

Redirecting all DNS Requests to pfSense

This should be what you need, also helps with pfBlocker if you are using that.

cURL is open source. If you are feeling adventurous you could compile a debug build and gdb through it.

You can specify DNS servers to use in curl --dns-servers but it seems to not be enabled by default.

Having the routers change DNS requests only masks the problem keep in mind.

You also would want the -L options as your www.nvidia.co.uk redirects a bunch, you won’t get a result without it.

Without “-L” he should still get the original 301 response and not the unable to resolve error.

1 Like

Yes. I should have said, a good result :smile:

Yep, same response with -L
Looks like I’d need to compile the debug version of curl to specify --dns-server

[sam@arch-anywhere]: ~>$ curl --dns-servers 8.8.8.8 -L www.nvidia.co.uk
curl: (4) A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision.

I also setup the DNS overrides, which did seem to work nicely - although I’ve disabled it for now whilst I try to get this working

Ok well I’m now confused. I restarted PFsense on a whim, and now its working. I kinda feel like I’ve just wasted everyone’s time now :frowning:

In any case, thanks to everyone for the help! Here’s hoping something here will help someone else down the line.

1 Like