Pinging external .dev tld resolve to localhost, but not with Dig

I installed puma-dev last year, forgot about it after I changed jobs. The gist is: it overwrote the dev tld to resolve locally during the entire google .dev tld ownership thing.

The problem I'm having is that npm is trying to resolve bit.dev, and can't, because it's looking now at the localhost.

PING bit.dev(ip6-localhost (::1)) 56 data bytes
64 bytes from ip6-localhost (::1): icmp_seq=1 ttl=64 time=0.037 ms
64 bytes from ip6-localhost (::1): icmp_seq=2 ttl=64 time=0.036 ms
^C
--- bit.dev ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1009ms
rtt min/avg/max/mdev = 0.036/0.036/0.037/0.000 ms

But, dig on the other hand correctly finds it.

/etc/resolvconf# dig bit.dev

; <<>> DiG 9.16.1-Ubuntu <<>> bit.dev
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30323
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;bit.dev.           IN  A

;; ANSWER SECTION:
bit.dev.        300 IN  A   104.18.26.210
bit.dev.        300 IN  A   104.18.27.210

;; Query time: 56 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Mon Oct 18 18:18:21 EDT 2021
;; MSG SIZE  rcvd: 68

The very amusing part of it all is that while Chrome can't seem to resolve any .dev tld's, Firefox can. That'd normally not be an issue, except

Unfortunately all of the answer on SU all seem to reference OSX, where the dns facilities are pretty different. I'm currently just at a loss as to the inconsistent behavior between chrome/firefox & ping/dig and what I'd have to touch to begin to figure out where this even begins.


Solution 1:

It seems puma-dev has messed with your DNS config.

Would the following issue help you figure out the problem: https://github.com/puma/puma-dev/issues/204

Also you might want to look at https://github.com/puma/dev-tld-resolver

Check the following files:

/etc/hosts you don't want any .dev entries
/etc/nsswitch.conf Remove dev_tld from the line hosts:
/etc/environment Check you don't have a DEV_TLD_DOMAINS defined

Puma could also have created filese under /etc/resolver/
Like /etc/resolver/dev