I have a number of Mac OS X El Capitan and macOS Sierra clients whose DHCP configurations give them the local IP address of a DD-WRT router with DNSMasq setup within my LAN.

This is so I can use server.example.com and have it go to and not our public IP address, and is far easier to manage than editing the hosts file of every mac, and also doesn't affect portable Macs when they need to connect to the same hostname from outside the building.

However, repeatedly some Macs keep 'forgetting' the local DNS. For example, when the problem occurs, I can ping the server hostname and get the external public IP. I can then clear the DNS cache, run the ping again and it's now the correct local IP address.

Does anyone run a similar setup, and know of any common pitfalls or issues, and how to get around them?

Prior to using DNSMasq on a DD-WRT router, I was using the Mac OS X Server App's DNS ability, but found it to be very slow as the same server was running File Sharing for the studio, so it was moved off.

I have even thought about running a scheduled command (either on each Mac, or via some Remote Desktop Management script) to clear the DNS every few hours or so.

  • Have you already tried to reduce ttl for your local records in dnsmasq (which will increase DNS traffic of course)?
    – klanomath
    Jul 4, 2017 at 18:01
  • @klanomath What's the syntax to do that? I can only see reference to local-ttl to use in the config, is that the right one to use? Jul 5, 2017 at 9:11
  • Check your dns server first to get the current TTL: dig @%IP_DD-WRT% %fqdn% (e.g. dig @ server.example.com). My local TTL is 10800 (OS X Server 3.2.2).
    – klanomath
    Jul 5, 2017 at 9:18
  • Apparently mine is set to 0..! Jul 25, 2017 at 12:53

1 Answer 1


Yes - this has been a pain for a long time and many generations of networking hardware and software.

Personally, I've given up on running my own dns and now pick one of two items.

  1. Use mDNS and host.local for resolution and let DHCP assign addresses from a pool.
  2. Set DHCP reservations for each device I care to connect to and use http://xip.io to resolve that IP by name.

In your case, I use in place of server.example.com where I need to put a FQDN in for resolving a server name. I've never had this be unstable, but if you do, there are other providers like http://nip.io do the same service.

  • Kind of good to hear that it's not just an issue I've had..! xip.io seems useful, but my case is more that I need server.example.com to be useable, in it's FQDN form, both inside and outside the building. Do you have an implementation example for mDNS? Jul 4, 2017 at 16:50

You must log in to answer this question.

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