10

After I installed Mountain Lion the other day I've noticed something very annoying. Almost every time I wake my iMac (27", mid-2010, CI7) from sleep: it seems that something DNS-related is broken. When I try connecting to other machines using their IP (v4 & v6) addresses I can SSH and send pings, but resolving host names isn't working very well.

Now I have not yet tried checking my DNS server logs to see if the requests are even making it there. Though I suspect that the DNS request are not making it to the DNS server since a quick reboot of the client machine or using another client machine works ok.

I've seen a couple of mentions of similar problems on other sites but no credible answers to why this problem appears, one user who was using WiFi apparently "fixed" it by toggling some random seemingly unrelated WiFi and sleep settings which just makes me suspect that this issue is some setting that got broken.

I'd love to find a reliable workaround/solution to this problem but I've double-checked all settings in the power management and network preference panes and it all looks fine. I have also tried re-saving the settings after making some changes and then reverting to the original settings just to see if that fixed it for me as well, no such luck. How to fix DNS resolving after wake from sleep?

Edit: I am only using wired networking myself and wifi is completely turned off. Both IPv4 and IPv6 settings have been made manually.

The network is a plain old 192.168.1.0/24 subnet with all machines connected to a fairly cheap managed gigE switch, 100/100 Mbps FTTH connection that goes to a FreeBSD box which acts as the gateway, dhcp (isc-dhcp for 192.168.1.1-72) and DNS (bind) server. IPv6 connectivity is through a Sixxs tunnel. Pretty standard setup that hasn't caused any problems in the past.

4
  • Please, could you add a little more detail? You mention other people's use of Wi-Fi, but it's not clear whether your own issues are with wired or wireless networking, or both. Jul 30, 2012 at 23:18
  • @GrahamPerrin The network is a plain old 192.168.1.0/24 subnet with all machines connected to a fairly cheap managed gigE switch, 100/100 Mbps FTTH connection that goes to a FreeBSD box which acts as the gateway, dhcp (isc-dhcp for 192.168.1.1-72) and DNS (bind) server. IPv6 connectivity is through a Sixxs tunnel. Pretty standard setup that hasn't caused any problems in the past.
    – mludd
    Aug 17, 2012 at 4:09
  • 1
    @mludd Can you reproduce it (and if so, under what conditions?) I recommend running Console, (and ideally monitoring system.log), and then trying to reproduce the issue. When the machine wakes up, clear the console display and/or set a marker, and then try to browse. See what happens in the logs - it might indicate what's going on with DNS.
    – Harv
    Aug 17, 2012 at 4:57
  • Good ways to troubleshoot this: on your FreeBSD router, - turn on DNS logging and review the logs using 'tail' and/or - run tcpdump e.g. sudo tcpdump -vv -i en1 port 53 Apr 3, 2013 at 21:50

2 Answers 2

1

I've had this exact same experience, though not every time. Sometimes it means sites that I have visited recently are unavailable but other sites I haven't visited in ages load just fine.

Usually flushing the DNS cache resolves it.

sudo killall -HUP mDNSResponder
1
  • 3
    It seems restarting mDNSResponder doesn't help, networking still ends up half-dead most times I wake my machine from sleep.
    – mludd
    Aug 3, 2012 at 8:56
1

Occasionally I get this as well. When it happens, I tell the system to flush the DNS:

# As root or sudo it
dscacheutil -flushcache

In the power settings, to avoid sleep/wake related issues, I've disabled the system's "put disk to sleep" option, as apparently, it can cause issues with SSD equiped boxes.

2
  • 1
    I've done this with the user and it solved my issue, not sure if it is due to an update.
    – Matteo
    Aug 26, 2014 at 8:56
  • I've seen some notes that they had changed the way the networking updates/changes. I've had nothing but trouble trying to do internet connection sharing. Am wondering if Yosemite will fix this. Oct 16, 2014 at 18:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .