3

I am using Mac OS X 10.8 to connect to two networks through ethernet and wifi and I am experiencing a problem with local DNS resolution. I would really appreciate your advice.

I am simultaneously connected to two networks. A local network through ethernet (eth) and to the internet through my company's wireless AP (wifi). I would like to be able to query by name my local computers (like ping computer1) but also I would like to have internet connection through wifi.

In the Network Preferences I have the following priority: First ethernet and then wifi.

By doing so, it works correctly when I ping local computers by IP. i.e. ping 192.168.1.1 works and I can access the internet as well. DNS settings for each interface are listed correctly in the Network Preferences settings. i.e. DNS for eth is 192.168.1.1 and search domain mydomain.com. For the wifi, DNS are also listed correctly with the settings my company provides.

If I disable wifi, local DNS works fine, when using ping computer1 or nslookup computer1. However, when wifi is enabled, I do not succeed in resolving names with the local DNS server. I have found that the resolv.conf file is overwritten when I enable wifi and therefore local DNS server is not contacted, instead my company's DNS is contacted. To be more specific, when wifi is enabled, the resolv.conf file holds only DNS information provided by my company (even though I prioritised it second position in Network Preferences ):

So when WiFi is enable, resolv.conf has the following:
domain my.work.domain.com
nameserver x.x.x.x
nameserver y.y.y.y
nameserver z.z.z.z

When WiFi is disabled, resolv.conf has the following:
domain mydomain.com.
nameserver 192.168.1.1

Similar issues appears when using scutil --dns.

When I have BOTH eth and wifi enabled, using scutil --dns, I get the following:
DNS configuration

resolver #1
search domain[0] : my.work.domain.com
nameserver[0] : x.x.x.x
nameserver[1] : y.y.y.y
nameserver[2] : z.z.z.z
if_index : 4 (en0)
reach : Reachable

(Here are listed but removed by me the rest of DNS resolvers #2 - #7 that normally Mac users have for internet )

DNS configuration (for scoped queries)

resolver #1
search domain[0] : mydomain.com
nameserver[0] : 192.168.1.1
if_index : 6 (en2)
flags : Scoped
reach : Reachable,Directly Reachable Address

resolver #2
search domain[0] : my.work.domain.com
nameserver[0] : x.x.x.x
nameserver[1] : y.y.y.y
nameserver[2] : z.z.z.z
if_index : 4 (en0)
flags : Scoped
reach : Reachable

When I disable WiFi and only keep ethernet, using scutil --dns, I get the following:
DNS configuration

resolver #1
search domain[0] : mydomain.com
nameserver[0] : 192.168.1.1
if_index : 6 (en2)
reach : Reachable,Directly Reachable Address

(Here are the same as above resolvers #2 - #7 that normally Mac users have for internet )

DNS configuration (for scoped queries)

resolver #1
search domain[0] : mydomain.com
nameserver[0] : 192.168.1.1
if_index : 6 (en2)
flags : Scoped
reach : Reachable,Directly Reachable Address

Thank you very much for the time you spend for my problem. Kind regards !

2
  • 2
    There seems to be too much answer in this question. What is the main issue you face? Do you need help on DNS and/or network routing as this probably is two fairly involved questions if you pick apart the naming issue from the routing issue.
    – bmike
    Jul 3, 2013 at 15:05
  • Thank you for your fast answer! I am sorry if I confused you with too much detail. There is no Routing issue just DNS issue.DNS settings set up by the ethernet (en2-highest priority) are overwritten when I enable WiFi (en0-lower priority).I would expect my DNS settings to be preserved given that they are assigned by the highest routing priority when I switch on WiFi. I have asked the question also in the Apple forums and was suggested to manually include the local DNS in the WiFi DNS settings. However, I still don't understand why local DNS settings set by en2 are overwritten when I enable en0 Jul 3, 2013 at 19:50

2 Answers 2

1

I think the DNS settings for each device are independent, so you need to configure DNS in the Advanced tab of system preferences for each NIC (en0, en1, etc.)

0

Try ping computer1.local. instead of ping computer1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .