Discussion Locked

DNS on multihomed machine

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Dear All,
I've got a little problem about my dual nic w2k adv server. I've searched MSKB with no good result. So, I come over you guys to help me.

Information:
- w2k adv server with SP2
- installed components: AD, DNS
- NIC#1: 192.168.0.1, NIC#2: 192.168.0.1
- Subnet: 255.255.255.0 for both NIC and LAN

1. Regarding DNS.
I understand that the machine should point the DNS information on itself. My question is: Should I point the DNS information on BOTH NIC? For example: I setup DNS information on NIC#1: 192.168.0.1 (itself) AND NIC#2: 192.168.0.2
Is it correct? What is consequences of being correct and wrong?

2. Regarding Routing traffic for load balancing.
I want all INTERNET traffic to come from NIC#1 only, and use NIC#2 for LAN traffic only. How do I do that?

Thank you very much. I'm giving 1000 point for these questions. Pls advise.

6 replies

by paulo.sedrez

1- you have a list of DNS servers, they are searched in order. It is OK. The consequence is that, if your DNS server (itserf) does not answer, it will ask itself again (on the second DNS IP provided).

2- When specifying a route, you can specify not only the gateway, but also the interface it will use and the cost - or metric - of the route. My suggestion is to add to the default route specification the interface NIC#1 (use the IP to do this) and, on the route to the LAN of NIC#1, increase its metric. So the traffic on LAN will go throught the lower metric, and all other traffic will be routed via NIC#1.

--Sedrez

by paulo.sedrez

I think you did not undertood the "metric" part. Each route has a "metric" (or "cost") associated. When two routes conflict, the system will always use the route with lower "metric" (or "cost").

Also, every interface has a route associated with its LAN. What you have to do is to change the metric of the LAN route associated to the NIC#1 interface.

This command should do the trick:

route change 192.168.0.0 MASK 255.255.255.0 192.168.0.1 metric 2 IF 1

You can try "route -p add" instead of "route change" if this does not works. In both ways, it will affect the persistent configuration, so you should not have to do this again on reboot.

You may want also create a default route with higher metric at NIC#2. This will do:

route -p add 0.0.0.0 MASK 0.0.0.0 METRIC 2 IF 2

However, sometimes Windows can be quite unpredictable. If it does not became persistent, you can create a script and run it at startup, as service, with servany - just mark it "automatic".

--Sedrez

by paulo.sedrez

Just to eager to respond, I forgot to say: the second default route creates a contigency route, in case of fail of NIC#1.

by shmaltz

It doesn't matter how many NIC's you have if you put in a DNS entery to any NIC the other NIC/s will use that as well.
Windows routing is smart enough not to route traffic to the wrong NIC when it has to send a packet. For example if you have NIC1=192.168.1.1 and NIC2=192.168.2.1, subnet mask 255.255.255.0 on both of the NICs and you send a packet to the IP Address 192.168.1.10 Windows will always use NIC1, for 192.168.2.10 Windows will always use NIC2. If the destination IP Address is not local to any of the NICs, Windows will use the default gateway. Since the default gateway is always local to one NIC that NIC is used for that packet.

BTW, in your question you say that NIC#1 is 192.168.0.1 and NIC#2 is 192.168.0.1 how is that possible? every IP address has to be unique.

by fajarpri

Again, sorry for the mis-typed. NIC#2 should be 192.168.0.2.

Windows always knows the best route? I don't think so, or at least until I set it up correctly.

Currently, windows always uses NIC#1 for internet traffic (I can see it from the lighton the icon). And..... (this is what annoys me), whenever I browse the LAN and copy some files from other machine, windows uses NIC#1 too! NIC#2 just stands there free of traffic! Now, pls tell me how to utilize both NIC.

This discussion is closed to new replies.