Find the answer to your Linux question:
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 25
Dear all, I have a big problem to configure Dynamic DNS and DHCP with Bind9 on a debian machine. I have no error with named-checkconf and named-checkzone. I have a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2012
    Posts
    15

    DDNS DHCP problem


    Dear all,

    I have a big problem to configure Dynamic DNS and DHCP with Bind9 on a debian machine.
    I have no error with named-checkconf and named-checkzone.

    I have a debian server with ip 192.168.1.1, and a debian host (machine-user) aquiring ip by dhcp (192.168.1.11 dhcp working).


    Here my NSLOOKUP commands :

    Code:
    > 192.168.1.11
    Server:		192.168.1.1
    Address:	192.168.1.1#53
    
    ** server can't find 11.1.168.192.in-addr.arpa.: NXDOMAIN
    > machine-user
    ;; connection timed out; no servers could be reached
    >
    From what you can see, nothing works...
    And, of course, I don't know why.

    All my DNS conf files are in /etc/bind.

    Can you take a look into them?

    dhcpd.conf
    Code:
    server-identifier       linux;
    ddns-updates            on;
    ddns-update-style       interim;
    ddns-domainname         "utopia.net.";
    ddns-rev-domainname     "in-addr.arpa.";
    ignore                  client-updates;
    
    include                 "/etc/bind/rndc.key";
    
    zone utopia.net. {
            primary 127.0.0.1;
            key rndc-key;
    }
    
    option domain-name              "utopia.net";
    option domain-name-servers      192.168.1.1;
    option ntp-servers              192.168.1.1;
    option routers                  192.168.1.1;
    option broadcast-address        192.168.1.255;
    default-lease-time              600;
    max-lease-time                  7200;
    authoritative;
    
    subnet 192.168.1.0 netmask 255.255.255.0 {
            range 192.168.1.10 192.168.1.200;
    
            zone utopia.net. {
                    primary 192.168.1.1;
                    key "rndc-key";
            }
    
            zone 1.168.192.in-addr.arpa. {
                    primary 192.168.1.1;
                    key "rndc-key";
            }
    }
    
    host dc {
            hardware ethernet 00:0C:29:18:FA:90;
            fixed-address 192.168.1.2;
    }
    named.conf
    Code:
    include "/etc/bind/named.conf.options";
    include "/etc/bind/named.conf.local";
    include "/etc/bind/named.conf.default-zones";
    
    controls {
            inet 127.0.0.1 allow {localhost; } keys { "rndc-key"; };
    };
    named.conf.local
    Code:
    zone "utopia.net" {
            type master;
            file "/etc/bind/db.utopia.net";
            allow-update { key "rndc-key"; };
            notify yes;
    };
    
    zone "1.168.192.in-addr.arpa" {
            type master;
            file "/etc/bind/db.utopia.net.rev";
            allow-update { key "rndc-key"; };
            notify yes;
    };
    
    include "/etc/bind/rndc.key";
    named.conf.options
    Code:
    options {
            directory "/var/cache/bind";
            auth-nxdomain no;    # conform to RFC1035
            listen-on-v6 { none; };
    };
    Fichier de zone db.utopia.net
    Code:
    $ORIGIN .
    $TTL    604800
    utopia.net      IN      SOA     utopia.net. root.utopia.net. (
                                  2         ; Serial
                             604800         ; Refresh
                              86400         ; Retry
                            2419200         ; Expire
                             604800 )       ; Negative Cache TTL
    ;
            NS      linux.utopia.net.
    $ORIGIN utopia.net.
    linux   A       192.168.1.1
    dc      A       192.168.1.2
    Fichier de zone inversé db.utopia.net.rev
    Code:
    $ORIGIN .
    $TTL    604800
    1.168.192.in-addr.arpa  IN      SOA     utopia.net. root.utopia.net. (
                                  2         ; Serial
                             604800         ; Refresh
                              86400         ; Retry
                            2419200         ; Expire
                             604800 )       ; Negative Cache TTL
    ;
            NS      linux.utopia.net.
    $ORIGIN 1.168.192.in-addr.arpa.
    1       PTR     linux.utopia.net.
    Fichier resolv.conf
    Code:
    main utopia.net
    search utopia.net
    nameserver 192.168.1.1
    Fichier /etc/hosts
    Code:
    127.0.0.1       localhost
    192.168.1.1     linux.utopia.net        linux
    
    # The following lines are desirable for IPv6 capable hosts
    #::1     ip6-localhost ip6-loopback
    #fe00::0 ip6-localnet
    #ff00::0 ip6-mcastprefix
    #ff02::1 ip6-allnodes
    #ff02::2 ip6-allrouters
    Please help

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,672
    What guide/web site were you following to set this up?

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Just Joined!
    Join Date
    Sep 2012
    Posts
    15
    Hi,

    I followed many guides, with 3 / 4 websites to compare between them.
    I incremented the version of the zones, now the connection timed out disapeared but I got a server can't find NXDOMAIN in the 2 ways.

    How I can see if DHCP update DNS?

  4. #4
    Just Joined!
    Join Date
    Sep 2012
    Posts
    15
    Up please, I really need help :/

  5. #5
    Linux User Krendoshazin's Avatar
    Join Date
    Feb 2005
    Location
    London, England
    Posts
    471
    First of all let's make sure DNS is working: can you resolve things that are in the forward zones? Try doing an nslookup on either linux or dc and show us the results of that.

    Additionally your named.conf file is spread out too much. This might be useful if you have a lot of zones and options, but otherwise it's just distracting.

    Try this for your named.conf:

    Code:
    include "/etc/bind/rndc.key";
    
    controls {
            inet 127.0.0.1 port 953
                         allow { 127.0.0.1; } keys { "rndc-key"; };
    };
    
    options {
            directory "/var/cache/bind";
            auth-nxdomain no;    # conform to RFC1035
            listen-on-v6 { none; };
    };
    
    zone "utopia.net" {
            type master;
            file "/etc/bind/db.utopia.net";
            allow-update { key "rndc-key"; };
            notify yes;
    };
    
    zone "1.168.192.in-addr.arpa" {
            type master;
            file "/etc/bind/db.utopia.net.rev";
            allow-update { key "rndc-key"; };
            notify yes;
    };
    What purpose does 'directory "/var/cache/bind";' serve? This is only required if you don't explicitly state the zone location.

    For instance, if I had 'directory "/var/cache/bind";', and then for my zone location I put 'file "master/example.com.zone";', then the zone location would become /var/cache/bind/master/example.com.zone.

  6. #6
    Just Joined!
    Join Date
    Sep 2012
    Posts
    15
    Hi,

    I modified named.conf with your code, and deleted the "directory" option.
    I restarted bind9 and dhcpd.

    Now I have a NXDOMAIN when I nslookup 192.168.1.11, and a connection timed out when I nslookup machine-user .
    192.168.1.11 is the IP given by the DHCP to machine-user.
    nslookup for linux and 192.168.1.1 works great, even on linux and user-machine.

    I have ton increment only the zones files isn't it? And only when I modify them.

    I really don't know why it's not working

  7. #7
    Just Joined!
    Join Date
    Sep 2012
    Posts
    15
    I have a "the working directory is not writable"
    and "managed-keys-zone ./IN: loading from master file managed-keys.bind failed: file not found"

    After I deleted the "directory /var/cache/bind"

    I think I have some trouble with named folders and rights.
    The easier thing is to put all the config of Bind in what folder?
    (i'm on Debian).

  8. #8
    Linux User Krendoshazin's Avatar
    Join Date
    Feb 2005
    Location
    London, England
    Posts
    471
    Quote Originally Posted by morpheus78 View Post
    nslookup for linux and 192.168.1.1 works great, even on linux and user-machine.
    In that case it looks like your DNS is working properly. Here is my named.conf, I've removed my keys for security reasons:
    Code:
    controls {
            inet 127.0.0.1 port 953
                    allow { 127.0.0.1; 192.168.1.5; } keys { "rndc-key"; "dhcpupdate"; };
    };
    
    options {
        directory "/etc/namedb";
        pid-file "/var/run/named.pid";
        statistics-file "/var/run/named.stats";
        query-source address * port 53;
        forward first;
        forwarders { 208.67.222.222; 208.67.220.220; };
    };
    
    zone "." IN {
        type hint;
        file "root.hints";
    };
    
    zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "master/0.0.127.in-addr.arpa.zone";
    };
    
    zone "enterprise.local" IN {
            type master;
            file "master/enterprise.local.zone";
            allow-update { key dhcpupdate; };
    };
    
    zone "1.168.192.in-addr.arpa" IN {
            type master;
            file "master/1.168.192.in-addr.arpa.zone";
            allow-update { key dhcpupdate; };
    };
    As long as your zone files are set up correctly and they are readable and writable by the user named is running as, then there shouldn't be a problem with these.

    And here is my /etc/dhcpd.conf file:
    Code:
    ddns-domainname "enterprise.local";
    ddns-update-style interim;
    ddns-updates on;
    ignore client-updates;
    
    subnet 192.168.1.0 netmask 255.255.255.0 {
            range 192.168.1.100 192.168.1.150;
            default-lease-time 86400;
            max-lease-time 86400;
            option routers 192.168.1.254;
            option ip-forwarding off;
            option broadcast-address 192.168.1.255;
            option subnet-mask 255.255.255.0;
            option domain-name-servers 192.168.1.200;
            option domain-name "enterprise.local";
    }
    
    zone enterprise.local {
            primary 192.168.1.200;
            key dhcpupdate;
    }
    
    zone 1.168.192.in-addr.arpa {
            primary 192.168.1.200; 
            key dhcpupdate;
    }
    As you can see from my log, this setup does the job:
    Code:
    Sep  9 13:34:50 wintermute dhcpd: DHCPREQUEST for 192.168.1.148 (192.168.1.254) from 00:13:e8:9c:98:39 via eth1
    Sep  9 13:34:50 wintermute dhcpd: DHCPACK on 192.168.1.148 to 00:13:e8:9c:98:39 (Emma-PC) via eth1
    Sep  9 13:34:50 wintermute dhcpd: Added new forward map from Emma-PC.enterprise.local to 192.168.1.148
    Sep  9 13:34:50 wintermute dhcpd: Added reverse map from 148.1.168.192.in-addr.arpa. to Emma-PC.enterprise.local
    Code:
    Neuromancer% nslookup emma-pc
    Server:         192.168.1.200
    Address:        192.168.1.200#53
    
    Name:   emma-pc.enterprise.local
    Address: 192.168.1.148
    If DNS is working fine and your rndc keys are set up, then it's DHCP that you need to solely focus on. Borrow from my configuration until you have something that closely resembles it, and pay attention to the system logs when DHCP hands out an addrress.

  9. #9
    Just Joined!
    Join Date
    Sep 2012
    Posts
    15
    Here is the code when my "machine-user" request for the DHCP.
    As you can see, the request works great, if I do an ifconfig on the machine-user, I can see 192.168.1.11.

    Code:
    Sep 10 15:13:08 linux dhcpd: DHCPDISCOVER from 00:0c:29:1a:58:73 via eth0
    Sep 10 15:13:09 linux dhcpd: DHCPOFFER on 192.168.1.11 to 00:0c:29:1a:58:73 via eth0
    Sep 10 15:13:09 linux dhcpd: DHCPREQUEST for 192.168.1.11 (192.168.1.1) from 00:0c:29:1a:58:73 via eth0
    Sep 10 15:13:09 linux dhcpd: DHCPACK on 192.168.1.11 to 00:0c:29:1a:58:73 via eth0
    I deleted the dot after the zones and modified the conf file in the same manner as yours but that all I have really different on the parameters.
    I have no error or anithing else in the var/log/syslog, do I need to look somewhere else to see log/errors?

    Thank for help !
    Last edited by morpheus78; 09-10-2012 at 01:40 PM.

  10. #10
    Linux User Krendoshazin's Avatar
    Join Date
    Feb 2005
    Location
    London, England
    Posts
    471
    In named.conf you're allowing localhost connections with
    Code:
     controls {
            inet 127.0.0.1 allow {localhost; } keys { "rndc-key"; };
    };
    But in dhcpd.conf you're trying to connect to DNS through 192.168.1.1.
    Code:
            zone utopia.net. {
                    primary 192.168.1.1;
                    key "rndc-key";
            }
    I know it's the same computer, but I believe the way this is set up could cause problems. What happens if you change the primary on the zones to 127.0.0.1?

Page 1 of 3 1 2 3 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •