Pages: [1] 2
  Print  
Author Topic: DHCP devices added to DNS  (Read 802 times)
PaulR
Newbie
*
Posts: 32


View Profile
« on: September 30, 2009, 10:22:43 pm »

I'd love to see a way to configure DHCP to feed local DNS with newly assigned devices.
Logged
dragonslayr
Full Member
***
Posts: 155


View Profile
« Reply #1 on: October 01, 2009, 04:27:18 am »

Hi PaulR!

I agree. My ipcop box does.  Smiley

I'm not in a position right now to install the dhcp module. But can you find the /usr/share/ebox/stubs directory and try something like this in the dhcp?

   host raleigh {
      option host-name "raleigh";
      hardware ethernet 00:A1:DD:74:C3:F2;
      fixed-address 192.168.1.6;
   }
Logged
sixstone
Zentyal Staff
Hero Member
*****
Posts: 1118


View Profile WWW
« Reply #2 on: October 01, 2009, 10:26:09 am »

I agree. My ipcop box does.  Smiley
Hi Dragonslayr,

In which way ipcop does? The DNS domain is updated every time a new IP is leased given the hostname set in DHCP configuration?

Thanks very much for your feedback, it is really appreciated.

Cheers,
Logged

My secret is my silence...
dragonslayr
Full Member
***
Posts: 155


View Profile
« Reply #3 on: October 01, 2009, 03:13:53 pm »

I don't know what they're doing behind the scenes, I've never looked. Smiley

But if you enter an address in the hosts file menu in the ipcop interface, the workstations can then resolve the address.

If I've time, I'll take a quick look this afternoon..
Logged
christian
Full Member
***
Posts: 147


View Profile
« Reply #4 on: October 05, 2009, 01:29:39 pm »

In which way ipcop does? The DNS domain is updated every time a new IP is leased given the hostname set in DHCP configuration?

dnsmasq does it, meaning (extract from feshmeat web site): "DHCP-allocated addresses to appear in the DNS with names configured either in each host or in a central configuration file".

Christian
Logged
c4rdinal
Full Member
***
Posts: 154


View Profile
« Reply #5 on: October 06, 2009, 01:46:09 am »

+1 vote for me on this feature!
Logged
peterr
Jr. Member
**
Posts: 83


View Profile
« Reply #6 on: October 15, 2009, 09:22:12 am »

As far as my experience goes IPcop only adds names to DNS if they are dynamically allocated by DHCP but not if they are fixed leases - in this case you need to add the name (given in the fixed lease) to the host file (IPcop has an edit host page for this task)

I would love to have a system that let me allocate fixed leases and automatically added the host names to my local DNS without messing with the host file of the server myself.
Logged
christian
Full Member
***
Posts: 147


View Profile
« Reply #7 on: October 16, 2009, 07:59:05 am »

I would love to have a system that let me allocate fixed leases and automatically added the host names to my local DNS without messing with the host file of the server myself.

Well, if it's fixed IP lease, effort to add it as DNS entry is not huge (ok, it depends on how many such fixed lease you intend to have. But if you have too many, you should ask yourself why you need DHCP  Wink)

I'm much more interested with capability, as long as we discuss DHCP stuff, to push more value along with IP address, not only IP + domain + default gateway.

Christian
Logged
uwe
Newbie
*
Posts: 1


View Profile
« Reply #8 on: October 24, 2009, 06:01:24 pm »

I'm just building a smal home network-server based on ebox.
I discovered this issue a few days ago too.

I surfed a littlebit around and read some docu, what I found was that
dhcpd supports an automatic update of a dns server each time a lease of an ip-address begins/ends.

For this you have to change the configuration of then dhcp and the dns serever.

A good german description is at http://www.linuxkramkiste.de/?Linux:DHCP-DNS

Here a brief description of what I have testet today (I hopefully didn't forgot anything).
I used the ubuntu beta 9.10 with eBox 1.3.5

The 4 steps are
1. generate a a key to allow updates on the dns-server

dnssec-keygen -a HMAC-MD5 -b 128 -n USER DHCP_UPDATER

2. modify /etc/dhcp3/dhcpd.conf (replace xxxx with the generated key)
.....
key DHCP_UPDATER {
     algorithm hmac-md5;
     secret "xxxxxxxxxx";
};


authoritative;

default-lease-time 1800;
max-lease-time 7200;

shared-network eth1 {

   subnet 192.168.1.0 netmask 255.255.255.0 {
               
                option routers 192.168.1.1;
             option domain-name "wlan";
             option ntp-servers 192.168.1.2;
             option domain-name-servers 192.168.1.2;
                default-lease-time 7200;
                max-lease-time 86400;
                ddns-domainname "wlan";


                range 192.168.1.128 192.168.1.159;
                zone wlan. {   
                     primary 192.168.1.2;   
                     key DHCP_UPDATER;
                }
                zone 1.168.192.in-addr.arpa. {   
                     primary 192.168.1.2;   
                     key DHCP_UPDATER;
                }
        }
}
......

3. modify /etc/bind/named.conf.local
...
key DHCP_UPDATER {
    algorithm hmac-md5;
    secret "xxxxxxxxxxxxxx";  (xxxx same as in dhcpd.conf)
  };
....
zone "wlan" {
   type master;
   file "/etc/bind/db.wlan";
        allow-update { key DHCP_UPDATER; };
};


4. Do not forget to stop appamor, it blocks named to create files in /etc/bind/*.jnl


after restarting all you should see all leased ip-addresses in the dns
You can check this in /var/log/daemon.log
The 2 lines with  added show that the name of the cleint is added to the dns (name-> ip and ip-> name)
...
Oct 24 17:22:04 ebox1 dhcpd: DHCPDISCOVER from 00:21:63:da:d0:17 via eth1
Oct 24 17:22:05 ebox1 dhcpd: DHCPOFFER on 192.168.1.132 to 00:21:63:da:d0:17 (vista3) via eth1
Oct 24 17:22:05 ebox1 dhcpd: Added new forward map from vista3.wlan to 192.168.1.132
Oct 24 17:22:05 ebox1 dhcpd: added reverse map from 132.1.168.192.in-addr.arpa. to vista3.wlan
Oct 24 17:22:05 ebox1 dhcpd: DHCPREQUEST for 192.168.1.132 (192.168.1.2) from 00:21:63:da:d0:17 (vista3) via eth1
...


It would be a great stuff if a future release of ebox includes this feature.
Another small improvement would be an addition to the dhcpd-configuration
 option ntp-servers x.x.x.x (address of the local ntpserver if configured)
Logged
sixstone
Zentyal Staff
Hero Member
*****
Posts: 1118


View Profile WWW
« Reply #9 on: October 30, 2009, 05:28:58 pm »

This is very useful uwe. Kudos!

Thanks very much for sharing this with us. It will be very useful as soon as we develop if you do not do first Wink.

Cheers,
Logged

My secret is my silence...
sixstone
Zentyal Staff
Hero Member
*****
Posts: 1118


View Profile WWW
« Reply #10 on: January 09, 2010, 04:54:30 pm »

Hello people,

I would like to let you know that I have already implemented that feature for next 1.4 release. The main feature is updating DNS domains from DHCP server when an IP address is leased/released. Two domains may be configured from eBox, one for ranges and one for fixed addresses, although you may use the same domain for this task.

Best regards and I hope this is helpful for you!
Logged

My secret is my silence...
dragonslayr
Full Member
***
Posts: 155


View Profile
« Reply #11 on: January 19, 2010, 09:46:41 pm »

On another note, I had need of something like this today on a domain. It dawned on me, I could use psexec for this.  (You can download psexec for free)

I first made a bat file called hosts.bat
The contents are below.  NOTE: The second line erases the current hosts file

copy C:\WINDOWS\system32\drivers\etc\hosts C:\WINDOWS\system32\drivers\etc\hosts.bak
echo 127.0.0.1 localhost > C:\WINDOWS\system32\drivers\etc\hosts
echo 12.5.66.222 wherever.com >> C:\WINDOWS\system32\drivers\etc\hosts

Then I call psexec.exe like this
psexec -c \\* hosts.bat

Whichs copies the batch file to all machines on the network and runs it.  This all the clients have current hosts file.

While this is not a "fix" it was a handy exercise..  Smiley
Logged
Saturn2888
Hero Member
*****
Posts: 677


View Profile
« Reply #12 on: February 07, 2010, 03:39:42 pm »

Hello people,

I would like to let you know that I have already implemented that feature for next 1.4 release. The main feature is updating DNS domains from DHCP server when an IP address is leased/released. Two domains may be configured from eBox, one for ranges and one for fixed addresses, although you may use the same domain for this task.

Best regards and I hope this is helpful for you!

I think this is extremely helpful, but there are some questions about the implementation I have.

1. When I manually entered in DNS entries, they were picked up by bandwidthd. This is no longer the case. I'm assuming the DDNS for DHCP isn't setup for reverse DNS lookups. Is this possible to be added in since manually doing it does this?

2. What is the way it pulls the DNS names? Does it do it from your static IP assignments in the DHCP server? If so, can I setup aliases for those?

3. If I have a router or switch with an IP that I had to assign to it statically because it doesn't accept DHCP, how can I set those up to be in the DDNS record? As it stands, I'm unable to ping them by hostname probably because their IP isn't leased out even though I put them in the DHCP log by MAC address and they are online.

4. Is it possible to configure the DDNS server to pull from the machine hostnames or set them up as aliases so I can have colissio.octen switch between 1.1.3.1 and 1.1.3.10? This might be more on the WINS server than the DNS server side of things though, but say I have a laptop, and I want to sometimes connect it via wireless and sometimes wired connections. Instead of having "ping blah" refer to just one IP address, it will look for that machine on whatever interface it gets to first which means that will prioritize the LAN interface (hopefully) because it should reply faster. If this is not really the way to go about doing it, is there a way to specify "ping hostname" to choose the fastest interface and have that reply hostname.domain?
« Last Edit: February 07, 2010, 05:28:52 pm by Saturn2888 » Logged
sixstone
Zentyal Staff
Hero Member
*****
Posts: 1118


View Profile WWW
« Reply #13 on: February 07, 2010, 10:52:37 pm »

I think this is extremely helpful, but there are some questions about the implementation I have.

1. When I manually entered in DNS entries, they were picked up by bandwidthd. This is no longer the case. I'm assuming the DDNS for DHCP isn't setup for reverse DNS lookups. Is this possible to be added in since manually doing it does this?

It is, but due to time constraints this could not be addressed in eBox 1.4. The main problem here is that we could collide manual and dynamic reverse zones... that's too bad. I am afraid that you have to add it manually. Sad

Quote
2. What is the way it pulls the DNS names? Does it do it from your static IP assignments in the DHCP server? If so, can I setup aliases for those?

The names are taken from the name you set in DHCP configuration page for fixed addresses. I'm afraid that current implementation does not allow you to have aliases for static IP assignments. If you want to set this up, use manual configuration Sad.

Quote
3. If I have a router or switch with an IP that I had to assign to it statically because it doesn't accept DHCP, how can I set those up to be in the DDNS record? As it stands, I'm unable to ping them by hostname probably because their IP isn't leased out even though I put them in the DHCP log by MAC address and they are online.

That's too bad. The only advice I may give you is using two domains (one for DDNS and one for this special case). The DDNS could be dyn.mydomain.com and the special case mydomain.com. Then in your search domain, set it up to dyn.mydomain.com and your Linux clients will be able to find themselves those hosts under mydomain.com zone. This is a workaround for this situation since eBox DDNS feature is not as advanced.

Quote
4. Is it possible to configure the DDNS server to pull from the machine hostnames or set them up as aliases so I can have colissio.octen switch between 1.1.3.1 and 1.1.3.10? This might be more on the WINS server than the DNS server side of things though, but say I have a laptop, and I want to sometimes connect it via wireless and sometimes wired connections. Instead of having "ping blah" refer to just one IP address, it will look for that machine on whatever interface it gets to first which means that will prioritize the LAN interface (hopefully) because it should reply faster. If this is not really the way to go about doing it, is there a way to specify "ping hostname" to choose the fastest interface and have that reply hostname.domain?

I don't know. You may run in parallel using -I flag to send out from both interfaces and check which one is faster?

Best regards,
Logged

My secret is my silence...
Saturn2888
Hero Member
*****
Posts: 677


View Profile
« Reply #14 on: February 08, 2010, 06:37:46 am »

I think this is extremely helpful, but there are some questions about the implementation I have.

1. When I manually entered in DNS entries, they were picked up by bandwidthd. This is no longer the case. I'm assuming the DDNS for DHCP isn't setup for reverse DNS lookups. Is this possible to be added in since manually doing it does this?

It is, but due to time constraints this could not be addressed in eBox 1.4. The main problem here is that we could collide manual and dynamic reverse zones... that's too bad. I am afraid that you have to add it manually. Sad

Quote
2. What is the way it pulls the DNS names? Does it do it from your static IP assignments in the DHCP server? If so, can I setup aliases for those?

The names are taken from the name you set in DHCP configuration page for fixed addresses. I'm afraid that current implementation does not allow you to have aliases for static IP assignments. If you want to set this up, use manual configuration Sad.

Quote
3. If I have a router or switch with an IP that I had to assign to it statically because it doesn't accept DHCP, how can I set those up to be in the DDNS record? As it stands, I'm unable to ping them by hostname probably because their IP isn't leased out even though I put them in the DHCP log by MAC address and they are online.

That's too bad. The only advice I may give you is using two domains (one for DDNS and one for this special case). The DDNS could be dyn.mydomain.com and the special case mydomain.com. Then in your search domain, set it up to dyn.mydomain.com and your Linux clients will be able to find themselves those hosts under mydomain.com zone. This is a workaround for this situation since eBox DDNS feature is not as advanced.

Quote
4. Is it possible to configure the DDNS server to pull from the machine hostnames or set them up as aliases so I can have colissio.octen switch between 1.1.3.1 and 1.1.3.10? This might be more on the WINS server than the DNS server side of things though, but say I have a laptop, and I want to sometimes connect it via wireless and sometimes wired connections. Instead of having "ping blah" refer to just one IP address, it will look for that machine on whatever interface it gets to first which means that will prioritize the LAN interface (hopefully) because it should reply faster. If this is not really the way to go about doing it, is there a way to specify "ping hostname" to choose the fastest interface and have that reply hostname.domain?

I don't know. You may run in parallel using -I flag to send out from both interfaces and check which one is faster?

Best regards,
Are any of these features (when you find out) going to be in 1.5 or 2.0? I would gladly test them as this is something I'm very excited about no matter how mundane it might be provided this is something other eBox users would want.

I wonder, if I manually configure dns, will it change my hostnames around? On a Windows machine, if I ping hostname, it will pick whichever adapter that hostname replies to. If I manually configure it in DNS, I will have hostname1.domain and hostname2.domain and aliases therein. Does that change how those are allocated?

Lastly, what's the -l flag? Do you mean ping -l as in setting up a preload? I don't know how that works. What is running in parallel? This is the most interesting to me as I would love to be able to access one machine from the interface that replies first. It would greatly minimize the effort necessary to choose the best link based on guestimation rather than actual network utilization.
Logged
Pages: [1] 2
  Print  
 
Jump to: