0

I'm trying to build a DHCP and DNS server. I check that client ip is ok to capture (11.11.0.1),

ping server ip (11.11.0.9) is ok, but ping domain name (example.com) is not ok.

On the server, ping IP is ok, ping domain name (example.com) is also ok.

The following is my trying steps, I don't know how to make it work, please tell me if anything wrong. thank you.

On CentOS Server side:

  1. config of "dhcpd.conf" as below:
    
    dhcpd_interfaces="eth0";
    default-lease-time 84600;
    max-lease-time 864000;
    ddns-update-style none;
    subnet 11.11.0.0 netmask 255.255.255.0{
    option routers 11.11.0.254;
    option domain-name "example.com";
    option domain-name-servers "11.11.0.9";
    };
    range 11.11.0.1 11.11.0.99;

DNS building Step:
1. "named.conf" as below:


options {
    listen-on port 53 { 127.0.0.1; 11.11.0.9; };
    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     { any; };
    recursion yes;

dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;

/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";

managed-keys-directory "/var/named/dynamic";

};

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

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

zone "example.com" IN { type master; file "fwd.example.com"; allow-update { none; }; };

zone "9.0.11.11.in-addr.arpa" IN { type master; file "rev.example.com"; allow-update { none; }; };

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

  1. create "fwd.example.com" in /var/named/


$TTL 86400
@   IN  SOA     dns.example.com. root.example.com. (
        2011071001  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)
@       IN  NS          dns.example.com.
@       IN  NS          dnstwo.example.com.
@       IN  A           11.11.0.9
@ IN A 11.11.0.39
dns IN A 11.11.0.9
dnstwo IN A 11.11.0.39

  1. create "rev.example.com" in /var/named/


$TTL 86400
@  IN  SOA     dns.example.com. root.example.com. (
        2011071001  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)
@       IN  NS          dns.example.com. 
@       IN  NS          dnstwo.example.com.
@       IN  PTR         example.com.
dns IN A 11.11.0.9
dnstwo IN A 11.11.0.39 9 IN PTR dns.example.com.
39 IN PTR dnstwo.example.com.

  1. service named restart

  2. domain-name probe:

dig dns.example.com

 ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> dns.example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6170
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1

;; QUESTION SECTION:
;dns.example.com.           IN  A

;; ANSWER SECTION:
dns.example.com.        86400   IN  A   11.11.0.9

;; AUTHORITY SECTION:
example.com.        86400   IN  NS  dnstwo.example.com.
example.com.        86400   IN  NS  dns.example.com.

;; ADDITIONAL SECTION:
dnstwo.example.com. 86400   IN  A   11.11.0.39  

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Jun  8 18:34:06 2015
;; MSG SIZE  rcvd: 97  

dig -x 11.11.0.9

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> -x 11.11.0.9
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47882
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;9.0.11.11.in-addr.arpa.        IN  PTR

;; ANSWER SECTION:
9.0.11.11.in-addr.arpa. 86400   IN  PTR example.com.

;; AUTHORITY SECTION:
9.0.11.11.in-addr.arpa. 86400   IN  NS  dns.example.com.
9.0.11.11.in-addr.arpa. 86400   IN  NS  dnstwo.example.com.

;; ADDITIONAL SECTION:
dns.example.com.        86400   IN  A   11.11.0.9
dnstwo.example.com. 86400   IN  A   11.11.0.39

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Jun  8 18:33:05 2015
;; MSG SIZE  rcvd: 133

ping 11.11.0.1 is ok

ping dns.example.com is ok


  [root@localhost ~] nslookup example.com
  Server: 127.0.0.1
  Address: 127.0.0.1#53

Name: example.com Address: 11.11.0.39 Name: example.com Address: 11.11.0.9

On Windows Client side:

C:>ipconfig -all
連線特定 DNS 尾碼 . . . . . . . . : example.com
~~~
IPv4 位址 . . . . . . . . . . . . : 11.11.0.1(偏好選項)
子網路遮罩 . . . . . . . . . . . .: 255.255.255.0
~~~
預設閘道 . . . . . . . . . . . . .: 11.11.0.254
DHCP 伺服器 . . . . . . . . . . . : 11.11.0.9
~~~
DNS 伺服器 . . . . . . . . . . . .: fec0:0:0:ffff::1%1
                                    fec0:0:0:ffff::2%1
                                    fec0:0:0:ffff::3%1
NetBIOS over Tcpip . . . . . . . .: 啟用

ping 11.11.0.9 is ok

ping dns.example.com couldn't find dns.exmaple.com

  • That ipconfig looks a bit wrong to me, you don't have your DNS server's IPv4 address listed there. You can also verify your DNS config by doing either "dig dns.example.com @11.11.0.9" on your client, or start up nslookup, then say "server=11.11.0.9" before searching for dns.example.com. – Smiling Dragon Jun 9 '15 at 4:38
  • All the parts about the DNS server config are irrelevant in this case. Simply state you tested your DNS server and it works. It's the DHCP part that is not working. BTW, didn't you fix the quotes for option domain-name-servers as discussed in your first question? – Sven Jun 9 '15 at 5:27
  • Sven, I solved that without quotes, thanks. As you told all parts of config are irrelevant, I didn't know how to fix it. @@ Any clue please? – 結西卡 Jun 9 '15 at 5:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.