Dig Command Not Working MacOS Mojave

I upgraded from MacOS Sierra to Mojave 10.14.3. Since the upgrade the dig command is no longer working. It returns "no servers could be reached". Here is an example query:


$ dig @ns1.google.com www.google.com


; <<>> DiG 9.10.6 <<>> @ns1.google.com www.google.com

; (2 servers found)

;; global options: +cmd

;; connection timed out; no servers could be reached


The commands "host" and "nslookup" work. I also discovered that if I add the dig option "+tcp" it works, for example "dig @ns1.google.com www.google.com".


The dig command was working fine in MacOS Sierra. Any ideas on why dig stopped working in Mojave?


Thanks for the help.





MacBook Pro 15", 10.14

Posted on Feb 16, 2019 9:48 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 16, 2019 1:06 PM

I figured it out. It appears to be Xfinity/Comcast. When you both said it was working for you, that gave me the idea that it might not be Mojave. I run dig all of the time, but maybe not in the last month. I turned on the hotspot on my iphone and connected the Mac to it. The dig command worked without using "+tcp". It appears that Xfinity/Comcast are blocking outbound UDP on port 53.


Thanks for your help. I really appreciate it.

Similar questions

6 replies
Question marked as Top-ranking reply

Feb 16, 2019 1:06 PM in response to KeithFetterman

I figured it out. It appears to be Xfinity/Comcast. When you both said it was working for you, that gave me the idea that it might not be Mojave. I run dig all of the time, but maybe not in the last month. I turned on the hotspot on my iphone and connected the Mac to it. The dig command worked without using "+tcp". It appears that Xfinity/Comcast are blocking outbound UDP on port 53.


Thanks for your help. I really appreciate it.

Feb 16, 2019 12:48 PM in response to leroydouglas

That's the correct command.


I just bought an iMac in December and it's running Mojave. It has the same problem.


dig @ns1.google.com www.google.com Does not work


dig + tcp @ns1.google.com www.google.com Works


host and nslookup both work.


When I examined the packets with tcpdump, I could see the UDP packets going out, but nothing coming back. When I did the same for nslookup, I could see packets coming back. This is weird.









Feb 16, 2019 10:12 AM in response to KeithFetterman



Maybe I am missing something; I enter your command:


$  dig @ns1.google.com www.google.com


; <<>> DiG 9.10.6 <<>> @ns1.google.com www.google.com

; (1 server found)

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41126

;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; WARNING: recursion requested but not available


;; OPT PSEUDOSECTION:

; EDNS: version: 0, flags:; udp: 512

;; QUESTION SECTION:

;www.google.com. IN A


;; ANSWER SECTION:

www.google.com. 300 IN A 172.217.1.196


;; Query time: 722 msec

;; SERVER: 216.239.32.10#53(216.239.32.10)

;; WHEN: Sat Feb 16 10:09:30 PST 2019

;; MSG SIZE rcvd: 59


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Dig Command Not Working MacOS Mojave

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.