Link to home
Start Free TrialLog in
Avatar of CHSnake
CHSnake

asked on

specifying DNS server

I just have a theoretical question. If a computer is connected to a router, then of course the default DNS server on the PC itself will show the 192.x for the router. What would be the effect of going into the TCP/IP properties and changing the DNS server from the router, to something external such as 4.2.2.1? How would hostnames be resolved in this case? Generally in this type of case it's better to make the DNS server changes in the router itself and not the computer right? Specifically I would like to know the effect of doing this. Thanks.
Avatar of Colin_UK
Colin_UK
Flag of United Kingdom of Great Britain and Northern Ireland image

I'm not really sure I understand the question, but I'll have a go.
Firstly routers dont usually have a DNS server running, you may be talking about a DSL modem/router type device. If so you set this to be the DNS server because it supports NAT and DNS relaying, meaning the router will pass the DNS request onto the DNS server designated by the ISP.

You can enter any address into your PC's DNS server and name resolution will work as long as A: You have a route to reach the IP B:The IP points to a DNS server and C: the DNS server allows you to query it.

The important thing is the IP used for your default gateway. As long as the gateway knows how to reach the DNS server in question the name resolution will succeed.

Assuming you are using a NAT ADSL/DSL/Cable router here's an example:
IP of your PC is private, ie: 192.168.0.2, LAN side of router 192.168.0.1. Set your default gateway to 192.168.0.1. The IP of the DNS will be the DNS server you want to use (usually your ISP's DNS servers). As the IP will be unknown to your network card it will pass the request to the default gateway (being your router). Your router may or may not know this address (likely not) and will pass the request to it's default gateway (your ISP's router) and so on until the request is correctly delivered and returned to your PC.

Hope this helps.
Colin
Avatar of giltjr
I'm not sure what you are trying to get at.  As Colin_UK states, as long as you have a valid path to a valid DNS reslover that you authrorized to use you will be able to reslove names.

However,  if you have more that one PC in your house, you may reduced network traffic over your ISP link buy using your router/gateway as the DNS reslover.  If your router/gateway caches DNS resultes, then if more that one computer attempts to reslove the same host name, the first request will cause your router to go to the Internet to reslove the name.  However the second request will be resloved by your router because it has the answer now, again assuming it caches the response.  

If your router/gateway does NOT cache responses, then it really doesn't matter where you point to.
Avatar of CHSnake
CHSnake

ASKER

Sorry guys, let me try to be more clear.

Basically I'm asking two questions, the second of which is a followup to the first. (I'll put 3 asterisks next to both my questions, just to differentiate them from my qualifying statements)


"Firstly routers dont usually have a DNS server running, you may be talking about a DSL modem/router type device. If so you set this to be the DNS server because it supports NAT and DNS relaying, meaning the router will pass the DNS request onto the DNS server designated by the ISP."


Yes, this is exactly the type of situation I'm referring to. If you leave the TCP/IP settings on your computer to "Obtain DNS server automatically," it's been my experience that ipconfig/all shows the DNS server as your default gateway, which in this instance is the modem/router NAT device (192.x). So the "flow chart" for the DNS query would be:

         PC
          |
      modem/router
          |
      ISP's DNS Server

I'm making it sound more complicated than it is, but ***what I wanted to know was if you go into those TCP/IP settings and change it from "obtain DNS automatically" to a static DNS server you specify, of say 4.2.2.2, 4.2.2.1, how exactly does the communication take place now, or how would the "flow chart" then look. The PC still queries the modem/router NAT device right? And after that, does it try to query the static DNS ip you specified in the computer, or does it have to ask the ISP's DNS server to do that? Do you pass through the ISP DNS server no matter what?

My followup question is, this may have already been answered, and I didn't interpret it correctly, but instead of going to the PC's TCP/IP properties to specify the DNS server, do most modem/routers have some sort of configuration option on the GUI setup interface to specify the primary and secondary DNS servers you would like to use? IF SO, what would be the effect of having one set of DNS servers in the modem/router, and a totally different set specified in the computer's?

I hope someone can understand all this, if not, just let me know, and I'll try to be more clear, if that's possible.
ASKER CERTIFIED SOLUTION
Avatar of Colin_UK
Colin_UK
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
https://www.microsoft.com/technet/itsolutions/network/evaluate/technol/tcpipfund/tcpipfund_ch07.mspx#EFAA

Note:  If the client cannot contact a valid DNS server then you cannot resolve names on other networks (ie: the Internet).

You can use DHCP to assign the DNS numbers to clients. Your router should have that option. If it's a modem supplied by your ISP, you may have to do some hacking.

You can also setup a PC in your network with 2 network cards to act as a router and use ICS(Internet Connection Sharing)/ICF(Internet Connection Firewall) or a 3rd party solution.  You will need to connect one card to the modem, the other card to a hub/switch.  A further explanation of this procedure is beyond the scope of this article.
To answer some misc questions.

It doesn't matter what DNS servers the router "sees", because it doesnt make DNS requests on your behalf unless one of the clients on your network uses that DNS server (your modem).. so if your PCs are all setup for different DNS server then the router has no need to make DNS requests.. several exceptions are if your router uses the Time Service (NTP) network Time Protocol, or the Dynamic Updates feature, then it will make requests on it's own behalf.

Secondly, you should always have a route to the internet, as some of the other patrons have said.

At least one DNS server or DNS relay should be configured without outbound forwarders (the DNS servers on the internet) which your router is no doubt pointed to, because it receives that info from your ISP's DHCP servers.  Similarly, the Cacheing DNS server in a corporate network must be configured with the IP address of at least one forwarder in order to reach hosts on other networks (in most cases, the Internet).

Thirdmost, If you point your PC to an invalid DNS server, as illustrated in the MSKB article i pasted in the first post, your PC will fall back on NetBios, since no WINS servers exist on your network, it will send broadcast packets throughout your Local Area Network.. not much of a consideration in a home network, but nonetheless, an unnecessary measure.  Amongst other things, you will notice when you open an Explorer Windows to an invalid network resource, it will take a long time to display+close.
If the DNS Server is a public DNS server & allows you to pull records then you will have no problems accessing the internet. Response time might be faster or slower depending on the DNS server, but usually you would get fastest resolution by using your ISPs DNS.

If you specify a DNS server which does not allow pulling of record then you will get DNS error page.

Using External DNS is very useful when your ISPs DNS server goes down if you remember their was DNS crash at comcast about year- year & half although I was on the same segment but I pointed my machines to use a different dns & which worked very well.