[RESOLVED] Client not recieving DNS information through DHCP

Issues related to configuring your network

[RESOLVED] Client not recieving DNS information through DHCP

Postby brandonbelanger » 2012/01/25 00:03:33

Hello folks! First post for me.

I'm a networking student working on my final project for my course. Currently I have a CentOS virtual machine as well as a Lubuntu virtual machine both running in VMware workstation (this is my test environment before I implement them on actual hardware).

I have configured both DHCP and DNS on my CentOS server (entmain.foes.com 192.168.0.1/24) and my Lubuntu client is picking up address information via DHCP but cannot resolve any hostnames on the domain.

Code: Select all
localadmin@linclient1:~$ dig foes.com

; <<>> DiG 9.7.3 <<>> foes.com
;; global options: +cmd
;; connection timed out; no servers could be reached
localadmin@linclient1:~$ nslookup 192.168.0.1
;; connection timed out; no servers could be reached


I can do successful nslookups on my server, however.

Code: Select all
[root@entmain Desktop]# nslookup 192.168.0.1
Server:      127.0.0.1
Address:   127.0.0.1#53

1.0.168.192.in-addr.arpa   name = entmain.foes.com.

[root@entmain Desktop]# nslookup entmain.foes.com
Server:      127.0.0.1
Address:   127.0.0.1#53

Name:   entmain.foes.com
Address: 192.168.0.1


Here are relevant config files:

Code: Select all
#dhcpd.conf

DHCPDARGS=eth0;
ddns-updates on;
ddns-update-style ad-hoc;
ddns-domainname "foes.com";
allow unknown-clients;
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.4;
option domain-name-servers 192.168.0.1;
option domain-name "foes.com";
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.150 192.168.0.199;
}


Code: Select all
#named.conf

options {
        listen-on port 53 { 127.0.0.1; };
        listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     { 192.168.0.0/24;localhost; };
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;
      
        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};

zone "foes.com" IN {
        type master;
        allow-transfer { 192.168.0.0/24; };
        allow-query { any; };
        file "/etc/named/foes.com";
};

zone "0.168.192.in-addr.arpa" IN {
        type master;
        allow-transfer { 194.168.0.0/24; };
        allow-query { any; };
        file "/etc/named/0.168.192.in-addr.arpa";
};

include "/etc/named.rfc1912.zones";


Code: Select all
$ORIGIN foes.com.
$TTL 3D
foes.com.       IN      SOA             entmain.foes.com        admin.foes.com. (
                        201201232               ; serial no yyyymmddn
                        1h                      ; refresh
                        3600                    ; retry
                        1w                      ; expire
                        1d                      ; cache time
)
foes.com.       IN      NS      entmain.foes.com.
foes.com.       IN      MX      10 entmail.foes.com.
entmain         IN      A       192.168.0.1
entmail         IN      A       192.168.0.2
entvpn          IN      A       192.168.0.3
entfirewall     IN      A       192.168.0.4


Code: Select all
$ORIGIN 0.168.192.in-addr.arpa.
$TTL 1D
0.168.192.in-addr.arpa. IN      SOA     entmain.foes.com.       admin.foes.com. (
                                        201201232       ; serial no yyyymmddn
                                        1h              ; refresh
                                        3600            ; retry
                                        1w              ; expire
                                        1d              ; cache time
)
                        IN      NS      entmain.foes.com.
1                       IN      PTR     entmain.foes.com.
2                       IN      PTR     entmail.foes.com.
3                       IN      PTR     entvpn.foes.com.
4                       IN      PTR     entfirewall.foes.com.


If someone can explain where I went wrong and why my client can't resolve any hostnames it would be greatly appreciated! Let me know if any other information is required.
brandonbelanger
 
Posts: 3
Joined: 2012/01/24 23:40:32

Re: Client not recieving DNS information through DHCP

Postby TrevorH » 2012/01/25 00:41:16

Does /etc/resolv.conf on the non-working machine contain the address of the DNS server? If it doesn't then you need to fix dhcp/dhclient. If it does then perhaps you've got a similar issue to this one from the other day?
User avatar
TrevorH
Forum Moderator
 
Posts: 9075
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Client not recieving DNS information through DHCP

Postby pschaff » 2012/01/25 00:52:13

Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.

I can't spot any problems, but then I'm not a DNS/DHCP expert. We might be better able to help if you used a CentOS client. I have no idea which end is the problem, but what does /etc/resolv.conf contain on the client?
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

[RESOLVED] Client not recieving DNS information through DHCP

Postby WhatsHisName » 2012/01/25 01:08:57

#named.conf

options {
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };

Note that named is only listening to 127.0.0.1, which is why named can resolve locally.

You need to add 192.168.0.1 to the list for other hosts on your lan to access named.

Or just comment out both lines.
User avatar
WhatsHisName
 
Posts: 1497
Joined: 2005/12/19 20:21:43
Location: /earth/usa/nj

Re: Client not recieving DNS information through DHCP

Postby brandonbelanger » 2012/01/25 18:23:11

Morning everyone. I've tried the things that have been suggested and still no luck.

Here is my resolv.conf on the Lubuntu Client

Code: Select all
domain foes.com
search foes.com
nameserver 192.168.0.1


And here is what I changed in named.conf on the server. I first tried...

Code: Select all
#named.conf

options {
listen-on port 53 { 192.168.0.0/24;127.0.0.1; };
listen-on-v6 port 53 { ::1; };


Then restarted named and release/renewed my dhcp info on the client and still no luck, I then tried commenting both lines out and repeating, again no luck.

Is my syntax wrong perhaps?

Thanks a bunch for the help so far though everyone!
brandonbelanger
 
Posts: 3
Joined: 2012/01/24 23:40:32

Re: Client not recieving DNS information through DHCP

Postby TrevorH » 2012/01/25 19:35:06

The listen-on port line that I use specifies the IP address of the machine that the DNS server is running on. If you omit it altogether then the default is to listen on all interfaces.
User avatar
TrevorH
Forum Moderator
 
Posts: 9075
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Client not recieving DNS information through DHCP

Postby WhatsHisName » 2012/01/25 19:37:52

Why not cut out the middleman and ask directly whether named is accessible locally and remotely?

Run "nslookup google.com 192.168.0.1" on both systems and determine named functionality directly.

DHCP-supplied info plays no role in that testing, so if both work, then start working your way up the food chain. Otherwise, it could be as simple as an iptables issue or an improperly assigned local IP address.

Also, a quick review of the syslogs on both systems when the failure occurs might be helpful.
User avatar
WhatsHisName
 
Posts: 1497
Joined: 2005/12/19 20:21:43
Location: /earth/usa/nj

Re: Client not recieving DNS information through DHCP

Postby brandonbelanger » 2012/02/07 22:05:04

Sorry I forgot to respond back to you guys!

It was the firewall, way to go me. Everything is working fine.

Thanks for the help guys. :-)
brandonbelanger
 
Posts: 3
Joined: 2012/01/24 23:40:32

Re: [RESOLVED] Client not recieving DNS information through DHCP

Postby AlanBartlett » 2012/02/07 22:49:51

Thank you for reporting back.

For posterity (and on your behalf), this thread is now marked [RESOLVED].
User avatar
AlanBartlett
Forum Moderator
 
Posts: 8975
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk


Return to CentOS 6 - Networking Support

Who is online

Users browsing this forum: No registered users and 1 guest