Why is the nameserver in “/etc/resolv.conf” not my router IP in Mac OS X?

2

1

I am running Mac OS X and I’m using DHCP. I was under the impression that my computer first went to the router to look up an IP address, and so on. So why isn't the router IP address an entry in /etc/resolv.conf? Instead, the file contains two IP address that are not even of the form 192.168.1.0-255.

user912083132

Posted 2015-09-07T05:04:20.133

Reputation: 137

4Sorry to bug you again, but what version of Mac OS X is this? Also, you say “the file contains two IP address that are not even of the form 192.168.1.0-255.” Then what are these addresses? IPv6 addresses? Or DNS server addresses outside of the 192.168.1.0-255 range? The more details you provide the better answers/clarifications the community can provide as well. – JakeGould – 2015-09-07T05:20:00.947

Apparently these are the DNS servers of my ISP. Since this is a home network, I was expecting my DNS server to actually be my router. I am confused on how a packet is able to go from my computer to the IP address outside my local network. Doesn't it first need to go to the router before this DNS server? – user912083132 – 2015-09-07T06:18:17.493

Have you checked the DNS settings for the active network interface under “[Device/Interface] -> Advanced… -> DNS” If they match the contents of /etc/resolv.conf that gives you another way to confirm this. But also some routers might just do DNS passthrough? These kind of details—like what router brand you are using and perhaps what modem as well—are all critical to helping the community better understand the whole picture so we can help you. – JakeGould – 2015-09-07T06:21:43.730

Yes, checking the DNS settings confirms this. The router brand is Arris. – user912083132 – 2015-09-07T07:03:53.280

Maybe the full brand and model number of the router/modem would help? – JakeGould – 2015-09-07T07:05:48.617

"Doesn't it first need to go to the router before this DNS server?" - Yes, it does. Thats what the subnet mask and standard gateway are for.

Your OS sees, that your DNS servers IP is not within your local network, which is determined from the subnet mask and your local IP which tells it, that it needs to send the physical ethernet packets to the Standard gateway machine, in this case your home router. – Tobias Mädel – 2015-09-07T13:06:16.393

Answers

10

There is absolutely no requirement for the DNS server(s) specified by DHCP to be the address of the router - and indeed that will only be the case where the router is also acting as a DNS server - which is usually true for small home networks, but often untrue for corporate networks - indeed the larger the network the less likely the DNS servers are related to the router.

DHCP allows for the specification of arbitrary DNS servers - the person that set up the DHCP server simply configured nameservers outside the range you expect. This could be for performance, convenience or other reasons.

In case I've slightly misinterpreted the question or its intent has been obscured by editing - /etc/resolv.conf contains information about DNS servers and name resolution. It says nothing about routing.

davidgo

Posted 2015-09-07T05:04:20.133

Reputation: 49 152

4

Your /etc/resolv.conf likely contains what your DHCP server told your computer to use for DNS servers.

Many home gateway routers run a DNS proxy service and thus serve out their own NAT private IP address as a DNS server address, and it sounds like that's what you're accustomed to seeing. However, it isn't really necessary for them to do that, and some home gateways just pass along whichever DNS server addresses they were configured (either manually, or dynamically via PPPoA/PPPoE/DHCP/etc.) to use.

Spiff

Posted 2015-09-07T05:04:20.133

Reputation: 84 656