Can anyone tell me if adding a file under /etc/resolver will work for DNS resolution using a DNS server other than what is handed out via DHCP ?
My issue is that I want to use OpenDNS for a clients home DNS resolution in order to take advantage of the filtering and anti scam capabilities but the massive disadvantage is that here in Australia things such as Apple content are delivered by a CDN (Akamai) which will then server content using a US based delivery point.
What I want to do is have the DNS server address handed out via DHCP to be the local router address (DNSMasq using OpenDNS DNS servers) and then, for example, place a file called apple.com under /etc/resolver with the following line:
The idea is that any DNS request to apple.com would be resolved by a TPG (my ISP) DNS server rather than the local routers DNSMasq daemon using OpenDNS servers.
So I have done this and the output of scutil --dns is:
DNS configuration resolver #1 search domain : harland nameserver : 192.168.10.1 nameserver : 192.168.10.1 if_index : 4 (en2) reach : Reachable,Directly Reachable Address resolver #2 domain : local options : mdns timeout : 5 order : 300000 resolver #3 domain : 254.169.in-addr.arpa options : mdns timeout : 5 order : 300200 resolver #4 domain : 8.e.f.ip6.arpa options : mdns timeout : 5 order : 300400 resolver #5 domain : 9.e.f.ip6.arpa options : mdns timeout : 5 order : 300600 resolver #6 domain : a.e.f.ip6.arpa options : mdns timeout : 5 order : 300800 resolver #7 domain : b.e.f.ip6.arpa options : mdns timeout : 5 order : 301000 resolver #8 domain : apple.com nameserver : 220.127.116.11 DNS configuration (for scoped queries) resolver #1 search domain : harland nameserver : 192.168.10.1 nameserver : 192.168.10.1 if_index : 4 (en2) flags : Scoped reach : Reachable,Directly Reachable Address macbookair:resolver
Now the output of an nslookup on apple.com is:
macbookair:resolver ilium007$ nslookup apple.com Server: 192.168.10.1 Address: 192.168.10.1#53 Non-authoritative answer: Name: apple.com Address: 18.104.22.168 Name: apple.com Address: 22.214.171.124 macbookair:resolver
So I am not using the TPG DNS server - I am still resolving against 192.168.10.1 which is the local router. Does the order of the resolvers matter ? ie. the entry created after I place the apple.com file in /etc/resolver is resolver #8:
resolver #8 domain : apple.com nameserver : 126.96.36.199
I would really like a way to make this work - any help would be appreciated.