LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   DDNS DHCP problem (https://www.linuxquestions.org/questions/linux-networking-3/ddns-dhcp-problem-4175425572/)

morpheus78 09-04-2012 08:11 AM

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 :(

ceyx 09-04-2012 10:03 AM

Increment the serial numbers, reboot and check the logs.

Post the output here if you like.

morpheus78 09-05-2012 02:08 AM

Hi,

I incremented the version of the 2 zones.
Now i got a :

server can't find 11.1.168.192.in-addr.arpa.: NXDOMAIN
server can't find machine-user: NXDOMAIN

How I can see if DHCP update my dns zones?

ceyx 09-05-2012 10:19 AM

I have to tell you that my knowledge of Bind and DHCP is limited, but perhaps we can both learn from this.

It is my understanding that Bind is used for Static IP's ; addresses that you have assigned.
DHCP is used when the server assigns the IP without your intervention.

So looks to me like we have two things going on here in confict:

You are telling BIND that the IP's are:

Quote:

Fichier de zone db.utopia.net
......
NS linux.utopia.net.
$ORIGIN utopia.net.
linux A 192.168.1.1
dc A 192.168.1.2
so how can you expect DHCP to assign 192.168.1.11 to a machine that Bind thinks is 192.168.1.2 ?
Did I misunderstand ?
Quote:

and a debian host (machine-user) aquiring ip by dhcp (192.168.1.11 dhcp working
Also, DHCP works by assigning the next available IP, not necessariy 192.168.1.11, according to the "lease" time set in DHCP,
so if it your machine is .11 today it may be .12 tomorrow, if .11's lease has not expired.

I would suggest using only static IP's on your lan only, and disable DHCP. It is more 'secure' that way too. I can't plug my laptop into your lan and get an IP !

Let us know how you are doing...

Bon Courage !

morpheus78 09-05-2012 12:30 PM

Hi,

192.168.1.2 is my DC (win 2K8R2) with a reserved IP as you can see on dhcpd.conf . I made a static declaration in the zone because the IP will not change.

192.168.1.11 is the IP that machine-user obtain from the DHCP.
I need to use DHCP, I can't populate DNS by myself, that why I want to use Dynamic DNS with DHCP update.

So, no idea why I obtain NXDOMAIN error in the 2 ways?


All times are GMT -5. The time now is 01:38 AM.