I'm trying to do the same. I'm going to manually run a caching dns server locally and have it learn intranets as I join.
I'm excited that the dns server might even be able to differentiate between intranet and internet hostnames before making the recursive call.
I'm worried that I'll either need short TTLs, or need to write hooks so that every time an interface changes I consider flushing the dns cache, or similiar.
I'll report back if successful...
The first 50%
After looking at the Wikipedia comparison of DNS servers, Dnsmasq comes to the top of my list.
Turns out brew
has a forumla for dnsmasq
, and it even has some services
sub-interface written for brew
...great, less to think about, just have to work out the config.
$ brew install dnsmasq # [libidn] internation domain names
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
# To have launchd start dnsmasq now and restart at startup:
$ sudo brew services start dnsmasq
(brew
also has bind
, but minimal state is attractive too me -- not having to clear it when doing network configuration).
Todo
- Figure out configuring Network Preferences to use my new dns, and
- Configure
dnsmasq
to ensure it can use intranet settings. (the real challenge)