Question Locked

DNS routing issues when the DNS server is connected to 2 networks

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

I have a DC in charge of 2 networks,
network A (192.168.1.0/24) and
network B (192.168.2.0/24)

Network A has Gateway A (192.168.1.254)
Network B has Gateway B (192.168.2.254)

The DC runs a DNS which resolves all IPs for our workstations. The DNS links up to OpenDNS.

We are a school, so network A is our administration net, and network B is our student net. The student network is filtered by OpenDNS, the admin net is unfiltered.

DNS requests from workstations in network A should be routed by the server to gateway A, requests from workstations in network B should go to gateway B. If they do not, OpenDNS will not properly filter.

Currently, the DNS server routes all requests through gateway A, regardless of whether the request came from network A or B.
Network A is unfiltered at OpenDNS, so they return correct results which then get sent to workstations in network B, who can then surf unfiltered.

How can I force the DNS server to route the requests based on what network the request came from?
Since the DNS listens on 2 IP addresses, one in each network, I assume it is possible somehow to send the requests back to the gateways of their respective networks.

I have tried setting static default routes for each network to their respective gateway, but that does not seem to do the trick.

26 replies

by oldbaritone

I've kicked around several ideas, but each seems to have shortcomings.

I have a SOHO network, and the grown-ups access the internet directly, and the kids go through a proxy server to reach the internet. Routings, time restrictions, and what-have-you are all rules in the proxy. The internet router is set up with both IP and MAC address filters to block direct access by the kids.

For that matter, it can all be done in a proxy server. Allow only the proxy to access the internet, and send everyone through the proxy. Have different rule sets based on IP address. Either way would work.

And a separate proxy server wouldn't impact performance of the file server.

by cg it

it only resolves queries and if it can't forward them to root hint servers or forwarder servers you specify. That forwarding isn't routing.

Routing is done by a router. So it is to that which you have to configure.

If you don't have a router, you can install Routing and Remote Access on a windows server and set the RRAS server to route only [not remote access]. However, to do that, you would need to install a 3rd network card which becomes the WAN link interface to which the routing fuctions use.

Simpler method is to just configure your router to do the work.

Added note: once you setup the server as a router, all traffic will be routed out the server. That can cause performance problems with the server because it not has to allocated resources such as processor time, memory to the routing fuctions.

by oldbaritone

What sort of sites would be appropriate for "a school" to access that would not be reachable with the OpenDNS lookup?

Check out their "Block-Page Bypass" feature.
It may accomplish what you want.

by greyit

Nono, I don't want the DNS system to route the workstations, I want it to forward its own DNS requests to the NIC from which the request came; in other words, requests from network A need to go back via NIC A to gateway A, requests from network B need to go back to NIC B to gateway B.
After which the workstations can go fetch the site on their own via their gateway.

Right now, OpenDNS thinks that all requests from network B come from network A, because the DNS contacts openDNS via network A, regardless from which network the request originated.

I am using RRAS to route each NIC to its appropriate gateway, but the DNS seems to ignore that and just routes any requests via network A, even if that request came from a workstation on network B.

About a proxy: we are going to be setting up a proxy, probably ISA. But somebody leaked the idea of access-blocking to the teachers, and now nobody (not even the principal) wants to wait until we can get the hardware and software set up. They want a result NOW, and I can't think of anything but OpenDNS to patch the hole.

The RRAS idea you mentioned is faulty since the server does not act as gateway. The networks have their own gateways, the server just serves up DNS replies. Only it goes to contact its own DNS server via network A always, even if it was queried by a workstation in network B; it should send DNS queries from network B to the internet via network B.

The misunderstanding about forwarding: well, maybe I used the wrong term; I do mean the forwarding of its own DNS queries, not the routing of the actual fetching of the site. The server is not a gateway.

by greyit

Their block page bypass feature is apparently only in the deluxe (as addon) and the enterprise packaging.
I am not able to clear 600$/year for 120+ computers (5$/user/yr rate) for the deluxe package.
This is a school, hell will freeze over before I can do that, it's hard enough getting money for the network antivirus ("aren't there free AVs around, cause I have one at home" is the most common response there)
Let's not even the "bypass included" enterprise package, which starts at 2000$/yr :-)

by oldbaritone

so they "want it NOW" and don't want to spend any money?

Switch to OpenDNS right NOW for everyone. If it creates an uproar, tell them "I'll have the proxy up in a week (or two, or whatever) and then we will have tiered access. This is all that can be done NOW, unless you can approve $600 for Block Page Bypass."

From the sound of it, I'll bet they'll grumble and wait, for free. But maybe you'll get a pleasant surprise and they'll cough up a few bucks.

Good luck.
h

by jpelectron

DNS Redirector allows for password bypass (even integrate Active Directory login) to bypass the block

by cg it

I think if you sat down and thought about how packets are handled, then you would know why DNS queries that originate from one subnet and are sent to another subnet are not sent back to the originating subnet if they can't be answered by the DNS server.

Routers do 1 of 3 things. Route packets to destinations it knows [local network] send packets to the default gateway or a static route it knows, or drop packets.

Routers don't return packets to it's originating source. If it doesn't know what to do with it, it drops the packet.

DNS queries that are can not be resolved by the local DNS server, are forwarded to root hint servers. Those packets are sent to next hop router because the server has that listed in it's network card configuration. Because that router has a next hop router and DNS servers listed in it's configuration [WAN link configuration], packets are forwarded to that. So on and so forth until the destination is reached.

by oldbaritone

I thought they're all getting sent back, it's just that he wants a different DNS result based on which subnet the request originates from.

He said they have one DNS server listening on 2 IP subnets. I believe the issue is how to get different DNS results from the same DNS server, depending on subnet. DNS doesn't usually work that way. Name-to-IP, but not Name-to-'well,that depends on who you are'.

by greyit

True, it's a right mess.
No, the DNS queries do not have to pass through another subnet to get at the DNS server; the server is in both local subnets.
I need it to forward the queries via the same subnet from which it received them; so queries from subnet A should go through the default gateway specified in the RRAS for subnet A; queries from subnet B should go the the default gateway specified in the RRAS for subnet B.

The inconsistencies in returns from OpenDNS servers to our DNS server can be handled by lowering the TTLs, I assume, so that the DNS will have to query on each request. Not the most elegant way, but if I connect our workstations to DNS query the outside directly, they won't be able to resolve internal IPs.

by greyit

Worst case scenario I'm assuming the proxy server will have to filter the connections even if the DNS queries pass via the other (non-proxied) gateway.

Putting up a secondary DNS server and making each serve its own subnet, would that be a solution?
They'd still have to be somehow synced for internal IPs though, I'm assuming that wouldnt be too much of an issue, seeing as to how each subnet would obviously have different IPs for each unit.

The only worry I have is that if I set up a second DNS (with a second DC I was planning to add for redundancy), they will sync their external IP lists as well as their internal ones, making the seperate filtering per subnet a moot point again.

by mafergus

Wouldn't the worst-case scenario be to totally isolate the networks to prevent the posibbility of students breaching the Teacher's data?

I may be missing something, but the issue is getting a secondary ip for recognitiion of the "different" filters for the students. Since the teachers aren't using any, it may be easier just to point them at the new DNS server and assign it a new external IP. OpenDNS only works based on the IP of the requesting server.

Assuming that the server is running active directory, you would want to make it another primary server.

by cg it

to the originating network and then be sent out that network's default gateway. That's routing.

by greyit

@CG IT: yes, with the condition that the DNS server is a member of both originating networks.

by cg it

that's not how it works. and this goes back to what's contained in the headers of packets and how routers and switches use that information to determine what to do with the packets. Source and destination information. Switches can read source information [MAC addresses] and determine if the packet's destination is in it's table. if so, it knows what port to send it to, simple switching. In routing, the router looks at the source and destination address to determine if the packet is destine for the local network or not. If not destine for the local network, the router then uses it routing table to determine if there is a static route for the traffic, if not then it send the packet to the default gateway [next hop router]. Otherwise, if the router doesn't know what to do with the packet, it drops it.

So a packet created in one subnet destined for another subnet, is not sent back to the originating subnet because it's not a destination listed in the header field of the packet. Its a source address.

by greyit

Oh yes, and the RRAS has static default routes defined for both NICs, so the DNS server has a way to the outside world on both networks, depending on which NIC it uses.

by greyit

Well, I can get them to spend the required 100$-something for an ISA license (educational discount), the 130$-something for the 2003 license will be pushing it, and those prices are not yearly, but one-time.

So as you suggested, I just started filtering both subnet at maximum. I reckon I can always patch a hostfile if something ultra-urgent comes up.

Money wise however, it's not our people that have the problem, it's that schools have to get approval for big expenditures from "above", and "above" doesn't care for anything but their bureaucracy.
Not in the budget in November = forget about it.
And even then they sliced my budget in half 2 days before it was due because they "forgot to tell us about the cuts"; so I fear no money will be forthcoming, as those with the cash will not be affected by the blocks :-)

by cg it

If you have students using computers in a computer lab, or any computer on the school premises that isn't school administrative comptuers, the network segment they are on, doesn't need to use the school administrative network and it's resources like DNS to reach the internet.

If anything you don't want a network segment that students or anyone else, has access to either physically or logically that can access the administration network either logically or hopefully physically.

you can accomplish this, depending upon the physical networking equipment you have, through routing and switching .

Lab computers go directly to the internet via the perimeter router on their own network segment. School administrative network is seperated by their respective network segment and if the admin is smart, their own internal firewall [router] behind the perimeter router.

by greyit

I completely agree with you that total segregation would be best, were it not that teachers and staff tend to "hop networks".

So a forest would be in order (or at least making the students zone a subdomain); that would mean a thorough reworking of the system (that I inherited btw, so this mess isn't *entirely* my fault :-)

Currently, students and staff do share DC, DNS and fileserver for roaming profiles storage.

The reason for network seperation is so the students can't access the database, which is in another school we work with, behind a VPN connection on our adminnet.

I did represent our network a tad simplistic: the adminnet has a sonicwall VPN between it and the router; students are exposed atm (another inheritance, but an old PC with extra RAM will be playing smoothwall or ISA server before long)

by greyit

PS: I do hope the admin is smart; I'm the admin :-p

by cg it

computers that students use would be, in my opinion, public computers and thus shouldn't be on a private network. I wouldn't even join them to the private domain.

by greyit

I'm thinking that will probably be a necessity, since my old plan seems unsalvageable.

Now, being a netadmin by heart, this does seem like a lot of fun to me, regardless of what my colleague claims (he's ready to throw in the towel and push host files to each pc via startup scripts);

any tips on good proxies while we're at it (I heard good things about smoothwall, but I just might go for ISA because it integrates so well with AD, allowing me to cut off classes that have exams without hurting the connection for the rest)

by greyit

I know, but the server has no default gateway. So I'm guessing he gets the appropriate "way out" from consulting his static routing tables and finding the default route with the lowest cost; since the defaults both cost the same, I'm guessing again that it's a random procedure on who's the lucky gateway.

So the only way out will be to use 2 DNS servers I guess.

by cg it

to use for answering queries if you have access to the Internet.

This applies to how computers are used, what they have to have access to, and the desgin of your network.

Since you mention this is a school and students use computers at the school, without really saying what that environment is, and what they do with them, I'll venture a guess.

School Lab network segment. If those lab computers need access to the internet, you use the IPS provided DNS servers. Queries for web sites are sent to the ISPs DNS servers.

Private network segment, you use the private DNS server to answer queries for local network resources. Then if that DNS server can't answer, it's forwarded to root hint servers.

So you do have 2 DNS servers to use to provide internet access to all users without having what I would classify as public computers, those students use, on a private network that must be secured from public access.

This discussion is closed to new replies.