Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a DHCP service installed on my distribution, Backtrack 5 R2 (ubuntu 10.04) and it was working fine, but when I began to configure DNS it suddenly stoped working, how can I make it work again??

The dhcp.conf file:

ddns-update-style none;
option domain-name "admin.servers.net";

default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;

subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.50 192.168.0.100;
  option domain-name-servers 192.168.0.2, 8.8.4.4;
  option routers 192.168.0.254;
  option broadcast-address 192.168.0.255;
  default-lease-time 600;
  max-lease-time 7200;
}

And when I restart the service it shows:

Internet Systems Consortium DHCP Server V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Wrote 4 leases to leases file.

No subnet declaration for restart (0.0.0.0).
** Ignoring requests on restart.  If this is not what
   you want, please write a subnet declaration
   in your dhcpd.conf file for the network segment
   to which interface restart is attached. **


Not configured to listen on any interfaces!

dhcp3-server has:

INTERFACES="eth0"

ip address:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 04:7d:7b:15:29:6b brd ff:ff:ff:ff:ff:ff
inet 192.168.0.2/24 brd 192.168.0.255 scope global eth0
inet6 fe80::67d:7bff:fe15:296b/64 scope link 
   valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 74:e5:0b:57:b4:82 brd ff:ff:ff:ff:ff:ff

ip route:

default via 192.168.0.254 dev eth0 
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.8 

/etc/network/interfaces:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.0.2
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.254

route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.254   0.0.0.0         UG    100    0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
share|improve this question
    
Why do you have ns1.example.org/ns2 in dhcp.conf? I would suggest stripping it down to absolute essentials and see if the problem occurs. If it does, see if ./dhcpd restart improves anything. Also add to your post the contents of /etc/network/interfaces. –  harrymc Oct 11 '12 at 8:58
    
Please also update above dhcp.conf. –  harrymc Oct 11 '12 at 14:26

3 Answers 3

Your configuration looks acceptable. It looks like you may be restarting the service incorrectly.

Using the exact configuration from your question:

root@bt:~# service dhcp3-server restart
* Stopping DHCP server dhcpd3 [fail]
* Starting DHCP server dhcpd3 [ OK ]

However this (wrong) command gives me the output you posted:

root@bt:~# dhcpd3 restart
Internet Systems Consortium DHCP Server V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Wrote 0 leases to leases file.

No subnet declaration for restart (0.0.0.0).
** Ignoring requests on restart.  If this is not what
   you want, please write a subnet declaration
   in your dhcpd.conf file for the network segment
   to which interface restart is attached. **


Not configured to listen on any interfaces!

If that does not work, try to reconfigure the package:

dpkg-reconfigure dhcp3-server

If that does not work, reinstall the package (saves configuration):

apt-get install --reinstall dhcp3-server
share|improve this answer
    
I figured it out when I was setting it up, now I restart with /etc/init.d/dhcp3-server restart and still through the error –  poz2k4444 Oct 11 '12 at 18:32
    
have you tried dpkg-reconfigure dhcp3-server? –  h0tw1r3 Oct 11 '12 at 18:35
    
Tried, still not working, is there any other file that could be causing problems?? other than I'm posting on the question? –  poz2k4444 Oct 12 '12 at 0:21
    
did you try apt-get install --reinstall dhcp3-server ? –  h0tw1r3 Oct 15 '12 at 17:39
    
yes I did, and now, I don't know if it's the same issue, the wicd doesn't work properly haha :( –  poz2k4444 Oct 15 '12 at 17:44

Which ‘DNS service’ do you use? Bind should normally not be a problem, but dnsmasq includes its own DHCP server.

To clarify: If dnsmasq is already running when you try to restart the DHCP server, the DHCP server would be unable to bind to port 53. Although I would expect it to output a slightly more sensible error message, technically it would not be configured to listen on any interfaces.

share|improve this answer
    
It's Bind, I've tried a lot of things, and one of them is stopping all the services and start DHCP and still not working –  poz2k4444 Oct 11 '12 at 17:52

Your dhcpd.conf looks fishy. Examples:

  • "option routers" : router gateway 192.168.0.254 seems unlikely, should normally be ".1".
  • "default-lease-time" : 10 minutes is much too low.

I suggest reading the tutorial at Linux DHCP Server Configuration and basing your dhcpd.conf on the example at the beginning, putting in your values (stop at "option time-offset").

If the problem persists please update your post, also adding the output of route -n.

share|improve this answer
    
The network was working well with 192.168.0.0 I had some experience on networking and I configured it well, it was working until I install DNS service, everything seems to be right in the configurations but the service just doesn't restart –  poz2k4444 Oct 11 '12 at 16:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.