OSX - Using different DNS for different network interface
I've an OSX Mountain Lion system and, if it's possible, I need to use different DNS servers for different networks. I'm going to explain my situation:
I'm at work. I'm connected to work network (by ethernet) and to personal network (by wifi) with this order in system preferences:
1.WIFI (en0)
2.ETHERNET (en2)
...because I want to use WIFI by default.
This works fine at IP level. I'm able to surf on internet and i reach work IPs. But it doesn't work at DNS level. If I try nskookup, DNS is always the DNS assigned by WIFI network and If I try to reach a work address (resolved by work DNS) it always use WIFI DNS.
Is there a way to force a new DNS for en2 interface ?
I tried to add a resolver configuration. Assuming that work ip addresses are 10.x.x.x and search domain is "ginger" This is my file "/etc/resolver/ginger":
domain ginger
nameserver 10.0.0.70
nameserver 10.0.0.71
nameserver 156.1.1.1
nameserver 156.1.1.2
I don't know if it is correct and if it's possible to do what I want using resolver config.
Thanks.
I've an OSX Mountain Lion system and, if it's possible, I need to use different DNS servers for different networks. I'm going to explain my situation:
I'm at work. I'm connected to work network (by ethernet) and to personal network (by wifi) with this order in system preferences:
1.WIFI (en0)
2.ETHERNET (en2)
...because I want to use WIFI by default.
This works fine at IP level. I'm able to surf on internet and i reach work IPs. But it doesn't work at DNS level. If I try nskookup, DNS is always the DNS assigned by WIFI network and If I try to reach a work address (resolved by work DNS) it always use WIFI DNS.
Is there a way to force a new DNS for en2 interface ?
I tried to add a resolver configuration. Assuming that work ip addresses are 10.x.x.x and search domain is "ginger" This is my file "/etc/resolver/ginger":
domain ginger
nameserver 10.0.0.70
nameserver 10.0.0.71
nameserver 156.1.1.1
nameserver 156.1.1.2
I don't know if it is correct and if it's possible to do what I want using resolver config.
Thanks.
No comments:
Post a Comment