This adds a simple function which populates the resolver list on a Mac OS X system by invoking the 'scutil' command and parsing its output. The output of this command is a set of sets of lines like this:
resolver #1
domain : foo.bar.com,
search domain[0] : foo.bar.com
search domain[1] : bar.com
nameserver[0] : 10.0.1.1
nameserver[1] : 10.0.1.2
order : 200000
Many of the entries are for multicast-DNS (blahblah.local) support and don't have any nameserver lines so they're ignored by this function.
Patch to invoke scutil(8) to discover resolvers
I've incorporated this for py3dns (the Python 3 port of pydns). It will be part of the next release.