Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a working DHCP server on CentOS, with /etc/dhcp/dhcpd.conf set up as follows:

subnet 192.168.1.0 netmask 255.255.255.0 {
    option routers 192.168.1.1;
    option subnet-mask 255.255.255.0;

    option domain-name "nunce.home"
    option domain-name-servers 192.168.1.254; #This is the DHCP and DNS server IP

    option time-offset 1;

    authorative; #Makes server primary
    default-lease-time 7200; #2h
    max-lease-time 14400; #4h
    range 192.168.x.x 192.168.x.x;
}

Clients connecting to network receive the IP in the given range. The only thing which isn't working is the DNS setup. I have a BIND DNS server which is accessible from the server itself and is resolving custom DNS entries. The Ubuntu Client I'm using for testing purposes is not showing the correct NS in its /etc/resolv.conf . If I try

host www.google.com

I don't get any response. Do you have any clue on what could be going wrong? If you need any other config file let me know.

share|improve this question
1  
What do you get on the client when you do dig www.google.com @192.168.1.254? –  MadHatter Jan 5 at 22:25
    
I get a timeout, but it is still working if tetsted on the server. I can ping the server though and the listen-on section is commented out in the /etc/named.conf file. –  Mateusz Kapusta Jan 5 at 22:34
    
So thanks to MadHatters suggestion i found out it was the iptables firewall that blocked the connections. By turning it off service iptables stop And trying to resolve from my client dig www.google.com @192.168.1.254 I started to get responses. All I had to do was to add a rule, an exeption on port 53 for interface eth0: iptables -I INPUT -p tcp --dport 53 -j ACCEPT and iptables -I INPUT -p udp --dport 53 -j ACCEPT And started to get replies from my server. The problem is that if I don't use dig @ command the client doesn't query the correct DNS server. –  Mateusz Kapusta Jan 5 at 23:23

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.