One possible workaround for this is to use a local lightweight DNS server, like dnsmasq, to answer to local queries and forward anything else upstream.
I'm using a small script from emzy over at macworld.com to set the order of my DNS servers (I'm on tethering and don't have access to the DNS tab in settings):
Filename: setdsn
-------------------------------------------------
#!/bin/bash
# Script is used to set the Nameserver Lookup under Max OS X 10.4 with the Console
# Script by Stephan Oeste <stephan@oeste.de>
if [ $# -lt 2 ] ; then
echo "Use: $0 <domain> <1.Nameserver> [2.Nameserver]"
echo "Example Use: $0 example.tld 1.2.3.4 1.2.3.5"
exit 1
fi
PSID=$( (scutil | grep PrimaryService | sed -e 's/.*PrimaryService : //')<< EOF
open
get State:/Network/Global/IPv4
d.show
quit
EOF
)
scutil << EOF
open
d.init
d.add ServerAddresses * $2 $3
d.add DomainName $1
set State:/Network/Service/$PSID/DNS
quit
EOF
-------------------------------------------------
Create the file
chmod +x setdns
And then use ist with (Example): setdns domain.com 12.23.34.45
together with a .plist loaded through i.e. "launchctl load -w /Library/LaunchDaemons/setdns.plist", to update the DNS automatically, whenever SystemConfiguration changes (e.g. I reconnect to the internet and get fresh DNS from DHCP). (I've hardcoded my DNS servers into the bash-script, so it's sufficient for me to just launch the script.)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.lionfix.setdns</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/setdns</string>
</array>
<key>WatchPaths</key>
<array>
<string>/Library/Preferences/SystemConfiguration</string>
</array>
</dict>
</plist>
P.S.: It's easy to install dnsmasq through homebrew (http://mxcl.github.com/homebrew/) just type "brew -vd --use-gcc dnsmasq" to install it and follow directions to copy the config file and launchdaemon in it's place. After that you just need to comment out "listen-address=" and "no-dhcp-interface=" and add "127.0.0.1" to those two lines in your /usr/local/etc/dnsmasq.conf. The best thing is that dnsmasq will actually check your /etc/hosts and respects /etc/resolv.conf.
Hope this helps!
PS: One could update the script to read the current DNS servers that you get from DHCP and prepend the list with 127.0.0.1, to get rid of hardcoded ips in the script or plist. Would be much appreciated : )