# Dynamic IP and BIND

## doubled157940

I have a network where a linksys router takes care of DHCP. What I want to do is setup a DNS server using BIND where I can keep DHCP on the router, while being able to reference computers by name. DNS and DHCP is on two different boxes and will never become one box. How can I configure BIND to work in this environment?

Thanks

----------

## vad3r

You should first check if your DHCP server is capable of using ddns updates (dhcpd: ddns-update-style ...). There's a lot of good documentation out there covering this subject.

----------

## doubled157940

It does support DDNS, but isn't that for DNS outside my home network? This is just for a DNS server inside my home network. I don't want anyone seeing me from the internet.

----------

## pteppic

^^ Yes it is, but it may have a separate section to do updates from DHCP. Why don't you just bind certain mac addresses to IP's in the DHCP config?

----------

## doubled157940

Because the DHCP server is a Linksys box, not a seperate computer. Here's how it works:

Internet

     |

Qwest Modem

     |

Linksys Router/Gateway/DHCP Server And Wireless 

     |---------------------------------------------------------------------|

DNS Server I want to set up (Would be space here) Rest of network

(I hope this posts the way I see it)

The Linksys box cannot bind IPs to MACs. I would assign a static IP per box, unfortunately some of them are Mobile so they can't have a static IP when they move from my network to somewhere else.

----------

## pteppic

I don't have any experience with linksys. Can you turn it of and get something better to do dhcp and just use it as a gateway?

----------

## darkphader

 *doubled157940 wrote:*   

> DNS and DHCP is on two different boxes and will never become one box.

 

Why not? It is most logical to use a DHCP server that can reserve IP addresses based on the DUID or MAC address.

Of course, BIND can do dynamic updates (as previously mentioned), but using a full featured DHCP server is probably a better choice - well...at least it's the one I would make :)

----------

## doubled157940

Because I'm not complete network admin for home. I currently live with my parents and my dad doesn't want things to get messed with while I do my own thing. Unlike allot of other families I've met, my father is a genius with computers and knows how "stable" networking can be. The DNS is my own thing plus it is only for my machines, on top of what I've mentioned before where I can't assign static IP because those computer need to be able to move to another network easily. What I've told is what I'm stuck with, and nothing will change unless there's a way to have Bind check the Linksys router for the DHCP table.

That's all I need, any hardware changes or changing box roles is not an option.

Sorry, not my fault, my dad won't budge. Any other suggestions?

----------

## darkphader

 *doubled157940 wrote:*   

> my father is a genius with computers

 

Hardly, or he would have fixed this up long ago (and I'm probably older than your father). A "genius with computers" would want proper IP and, depending on the OS's involved, NetBIOS, name resolution, and would probably replace that Linksys router with an openBSD box running PF, DHCP, and BIND (or djbdns). Personally I just use openBSD for my firewall duties and use a Gentoo server for DNS and DHCP.

Chris

----------

## doubled157940

 *darkphader wrote:*   

>  *doubled157940 wrote:*   my father is a genius with computers 
> 
> Hardly, or he would have fixed this up long ago (and I'm probably older than your father). A "genius with computers" would want proper IP and, depending on the OS's involved, NetBIOS, name resolution, and would probably replace that Linksys router with an openBSD box running PF, DHCP, and BIND (or djbdns). Personally I just use openBSD for my firewall duties and use a Gentoo server for DNS and DHCP.
> 
> Chris

 

This is just in my eyes, plus he doesn't like dealing with networking because it can a very painful experience. I would like to reestablish that this forum (last I checked) is for getting and giving help, not putting anyone in existence down or any branch there of. So if we can try and refocus this thread to point of why it's here in the first place. I would like some solutions if any, and if there are none and someone can say (with absolute certainty) that there is no solution in my case due to bind restrictions, please say so and leave it at that. There are always going to be different ways of doing things, that's the reason there's open source and a competitive market. In addition, please hold all other side comments to yourself so that this thread and forum that holds it, maintains its purpose of trying to let others helps others and others receive that help. With that, I thank you and ask again, can someone help me with my problem, please?

----------

## pteppic

Well, if your father is adamant that DHCP will stay on the router, then you will have to write a script to scrape the lease info from it and update BIND.

----------

## olivier elmekki

Is there at least one machine that has a static IP? 

If so - and if you *really* don't want to use DHCP - you could put a bind server on it, configure it to take his configuration from a mysql database, and wrote client for each others machines that will contact the bind server and update it (so this one must be static).

I've described a similar procedure here and here, if this can help.

----------

## doubled157940

Thank you very much. As it turns out I do have one Gentoo machine that I have as a static IP because I use it as a file/web server for my house. It is also the same machine that I was hoping to put BIND on. I'll look into your suggestions and report the verdict. Thanks again.

----------

## nobspangle

Here's the bit I don't understand.

Your Dad doesn't want you to play around with the network because he doesn't want his stuff to be messed up. That's fair enough.

You have to use DHCP on your machines because you move them around between different networks and don't want to reconfigure them all the time. Again fair enough

How do you expect these machines, which are dynamically configured, to use the bind DNS server you are setting up without playing with the DHCP server settings on the router and therefore messing with your Dad's network?

----------

## doubled157940

 *nobspangle wrote:*   

> Here's the bit I don't understand.
> 
> Your Dad doesn't want you to play around with the network because he doesn't want his stuff to be messed up. That's fair enough.
> 
> You have to use DHCP on your machines because you move them around between different networks and don't want to reconfigure them all the time. Again fair enough
> ...

 

Because there is a way to have Dynamic IP and DNS on the same network. It's not a matter of configuring the router for anything. I just need to have bind lookup the routers IP table and then sort things from there.

----------

## nobspangle

how will your clients know to use the bind DNS server? You will have to configure the Linksys box to give out the bind IP as the DNS server.

----------

## doubled157940

 *nobspangle wrote:*   

> how will your clients know to use the bind DNS server? You will have to configure the Linksys box to give out the bind IP as the DNS server.

 

The clients will know to use bind because you have to configure it to use bind in the first place. You have to tell the client locally where the bind DNS server is at. Which in my case is the only static IP machine on the network.

----------

## alex.blackbit

maybe gnudip can help you set up the dynamic dns you want.

----------

## olivier elmekki

@alex.blackbit : thanks for the link, I searched for a while before writing my own application and didn't succeeded.

This project seems far more mature that what I've wrote. The only inconvenient  is that it is written in a scripting language. Is this server acts as name server, or is it communicates with name server?

----------

## nobspangle

 *doubled157940 wrote:*   

> The clients will know to use bind because you have to configure it to use bind in the first place. You have to tell the client locally where the bind DNS server is at. Which in my case is the only static IP machine on the network.

 

So you will statically configure your clients to use the bind server as their DNS? Then what happens when you move these clients to a different network where your bind server is inaccessible?

----------

## olivier elmekki

 *Quote:*   

> Then what happens when you move these clients to a different network where your bind server is inaccessible?

 

That's really no problem. You just have to set the home bind in the first place in resolv.conf, set a open bind server in second, and configure your netscript not to ask for a nameserver when connecting.

Or best of best, if you are used to bind admin, set the home bind in first place and install a local one and set it at second place.

----------

## alex.blackbit

i fount gnudip quite a while ago when i was searching for something that could help implementing a homebrew dyndns service, in this case for clients on the internet, outside the local lan.

unfortunately the codebase is quite old and unmaintained, it would be good to have something a bit newer.

----------

## olivier elmekki

well, I've wrote one (links are my first post), but it is not as featured as gnupid, and it's not really designed to be distributed, the target audience is more admins/devs that want to save some time. There's a bit of admin stuff to do, and it should be adapted for specific needs...

----------

## darkphader

 *olivier elmekki wrote:*   

> That's really no problem. You just have to set the home bind in the first place in resolv.conf, set a open bind server in second, and configure your netscript not to ask for a nameserver when connecting.

 

Actually you would need to inform your dhcp client to prepend your local name server, and accept the others via dhcp because in many cases you can't just use any dns you want (many networks, especially corporate ones, will point you to their local DNS servers/caches and block the ports to DNS servers outside the network), so a static list of others would be useless in some cases.

Although even this comes at a cost - about an extra second for every lookup due to the timeout wait on the primary server when it is not available. Certainly not an ideal scenario.

----------

## doubled157940

In my case, the mobile machines are Windows. They are never going on a corporate network, but that doesn't mean you can't discuss it here.   :Razz:   But I also know for fact on Windows, if the DNS servers aren't found when the network card is turned on it doesn't complain, it'll use whatever it'll get on the network it's on.

Still trying to implement some of the great suggestions you all have given me. Would've come back with a verdict sooner, but work is kicking me all over because we're nearing the end of a fiscal calender quarter. Thank you all for the feedback thus far.

----------

## darkphader

 *doubled157940 wrote:*   

> But I also know for fact on Windows, if the DNS servers aren't found when the network card is turned on it doesn't complain, it'll use whatever it'll get on the network it's on.

 

Don't know what you mean here. A Windows box will only use DNS servers that are configured either manually or via DHCP, it will not go out and find non-configured DNS servers. And there will still be a timeout delay if the primary server is down.

Modern Windows boxes do run a stub cache (the dnsclient service) that will not act as a resolver. In some cases better overall performance can be had by shutting this service down (when on a local subnet that has a dnscache serving it).

----------

