DNS Patch
I've got a Linux server getting it's address from DHCP on a DI-524 router. This server is the local DNS server. My server requires a few rules I've discovered to work, and one of them is that the DNS server must look for it's DNS server on itself.
So, DNS in our house goes this way: Clients in one domain get their DNS server from the router which says that the first DNS server is the Linux server connected to the router. The second DNS server is our other router. In this manner, the Internet will not cease to function if the server goes down by mistake, however the server provides extra functions.
So, if the server also points to the router, then DNS won't work because the packets will get to the router and go in a loop between the Linux server and the router. It'd go to the router, which says DNS server is the server, then the server says it's the router, which starts DNS over again.
But if the server is it's own DNS server, then the loop will end at the server, if it's functioning, otherwise it will go to the external DNS server. The external DNS server is an internal one which doesn't really do anything, except send it to the real external DNS server. That's because the routers act as DNS servers, but not as internal ones. They just pass everything to the WAN. That's the reason for DNS on the server.
The problem is that at certain times the DNS server on the Linux is changed to be the router. It seems to be only when the server gets it's DHCP address from the router. So this is an exceptional case then I'm noticing. So my idea is that unless it's a bad option in the DCHP or DNS client that changes /etc/resolv.conf, then I need to make a patch of some sort.
I could find a way to change the way things are working internally somehow, but unless that's all that's wrong, I'd just be masking the fact that this seems to be an exception to the way things are supposed to normally work. I want to make it clear that this is probably just an exception to the normal ways of doing things, and therefore, unless it's a bad option, then I can let it change the file, and then execute the patch which says, "but this is an exception", an therefore changes it right back, if the exception should happen.
So the question is, how do I catch the events? Should I maybe use the ifup script thingy? Will that catch every time the lease get's renewed? Are there any other reasons that this behavior may occur? I'm going to do this for now, unless it doesn't work.
|