DNS query timeout except in Chrome browser

I recently got DNS lookup problems but cannot really figure out exactly when it stopped working since my main browser Chrome seems to function properly (with only occasional timeouts). Safari, Firefox, Network Utility, homebrew and usual terminal commands aren't able to resolve any IP:

$ time host apple.com

;; connection timed out; no servers could be reached


real 0m12.015s

user 0m0.004s

sys 0m0.004

"$ sudo tcpdump -vvv -s 0 -l -n port 53"show no ethernet traffic during this session. Specifying my DNS server (or any DNS server) works with tcpdump showing normal DNS traffic:

$ time host apple.com 192.168.1.1

Using domain server:

Name: 192.168.1.1

Address: 192.168.1.1#53

Aliases:


apple.com has address 17.172.224.47

apple.com has address 17.142.160.59

apple.com has address 17.178.96.59

apple.com mail is handled by 10 nwk-aaemail-lapp01.apple.com.

apple.com mail is handled by 10 nwk-aaemail-lapp03.apple.com.

apple.com mail is handled by 10 nwk-aaemail-lapp02.apple.com.

apple.com mail is handled by 10 ma1-aaemail-dr-lapp02.apple.com.

apple.com mail is handled by 10 ma1-aaemail-dr-lapp01.apple.com.

apple.com mail is handled by 10 ma1-aaemail-dr-lapp03.apple.com.


real 0m0.033s

user 0m0.005s

sys 0m0.005s

I have only one active network service "Wi-Fi2". I have tried switching to "Thunderbolt Ethernet" with the same result:

$ networksetup -listnetworkserviceorder

An asterisk (*) denotes that a network service is disabled.

(1) Wi-Fi2

(Hardware Port: Wi-Fi, Device: en0)


(2) Bluetooth PAN

(Hardware Port: Bluetooth PAN, Device: en3)


(3) Thunderbolt Bridge

(Hardware Port: Thunderbolt Bridge, Device: bridge0)


(4) Thunderbolt Ethernet

(Hardware Port: Thunderbolt Ethernet, Device: en5)


(5) Parallels Host-Only #1

(Hardware Port: Parallels Host-Only #1, Device: vnic1)

It doesn't seem to matter which DNS server I configure:

$ networksetup -getdnsservers "Wi-Fi2"

192.168.1.1

I've done a fair amount of surfing on this issue and tried both restarting computer and com.apple.mDNSResponder.plist (which I checked against time-machine) and need guidance on how to trouble-shoot further. Maybe a guide on how to use dtrace on the host command.

Any ideas?

MacBook Pro (Retina, 13-inch, Late 2013), macOS Sierra (10.12.2)

Posted on Feb 1, 2017 12:13 PM

Reply
1 reply

Feb 2, 2017 9:59 AM in response to TorgilS

SOLVED: This was due to lack of execute-permissions on the /var/run folder. Dunno why Chrome worked.


Since /etc/resolv.conf is a link to ../var/run/resolv.conf...

$ ls -l /etc/resolv.conf

lrwxr-xr-x 1 root wheel 22 2 Feb 18:34 /etc/resolv.conf -> ../var/run/resolv.conf


... and programs wasn't allowed to access /var/run...

$ ls -ld /var/run

d-w------- 30 root daemon 1020 2 Feb 18:43 /var/run

... DNS service didn't work. Changing folder permissions solved the problem:

$ sudo chmod 755 /var/run
$ time host apple.com

apple.com has address 17.142.160.59

apple.com has address 17.172.224.47

apple.com has address 17.142.160.59

apple.com has address 17.178.96.59

apple.com mail is handled by 10 nwk-aaemail-lapp03.apple.com.

apple.com mail is handled by 10 ma1-aaemail-dr-lapp01.apple.com.

apple.com mail is handled by 10 ma1-aaemail-dr-lapp03.apple.com.

apple.com mail is handled by 10 nwk-aaemail-lapp02.apple.com.

apple.com mail is handled by 10 nwk-aaemail-lapp01.apple.com.

apple.com mail is handled by 10 ma1-aaemail-dr-lapp02.apple.com.


real 0m0.031s

duser 0m0.004s

sys 0m0.004s

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.

DNS query timeout except in Chrome browser

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