OSX: Per domain DNS servers

Little known OSX feature (or at least it was new to me):

You can specify a separate DNS resolver configuration per domain. This can be useful to supplement or over-ride VPN connections.

Best of all, it's really easy -- to specify a custom server for mydomain.int, just run:

sudo mkdir /etc/resolver
sudo echo "nameserver > /etc/resolver/mydomain.int

… and that's it.

It's documented in resolver(5), available on apple's website.

Note: You can't use tbhis to override the default resolver. Use System Preferences for that.