LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   DDNS on Centos (https://www.linuxquestions.org/questions/linux-server-73/ddns-on-centos-928531/)

devilboy09 02-09-2012 02:36 PM

DDNS on Centos
 
i'm trying to configure ddns on centos, but it doesn't work.
i have a machine named centos.domain.com that i've installed dhcp and bind on it.also i have two other machine, centos2.domain.org and bt.domain.org.

here's my configuration files :
/etc/dhcpd.conf:
Code:

ddns-update-style interim;
ignore client-updates;
ddns-domainname "domain.org";
include "/etc/rndc.key";
zone domain.org. {
primary 127.0.0.1;
key rndckey;
}

subnet 10.1.1.0 netmask 255.255.255.0 {

# --- default gateway
        option routers                        10.1.1.10;
        option subnet-mask                255.255.255.0;

#        option nis-domain                "domain.org";
        option domain-name                "domain.org";
        option domain-name-servers        10.1.1.10;

        option time-offset                -18000;        # Eastern Standard Time
#        option ntp-servers                192.168.1.1;
#        option netbios-name-servers        192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
#        option netbios-node-type 2;

        range dynamic-bootp  10.1.1.12 10.1.1.16;
        default-lease-time 21600;
        max-lease-time 43200;

        host bt {
        hardware ethernet 00:0c:29:a9:cd:96;
        fixed-address 10.1.1.13;
        }

}

/etc/named.conf :
Code:

// Red Hat BIND Configuration Tool
//
// Default initial "Caching Only" name server configuration
//

options {
        directory "/var/named";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        /*
        * If there is a firewall between you and nameservers you want
        * to talk to, you might need to uncomment the query-source
        * directive below.  Previous versions of BIND always asked
        * questions using port 53, but BIND 8.1 uses an unprivileged
        * port by default.
        */
        // query-source address * port 53;
};

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

zone "localdomain." IN {
        type master;
        file "localdomain.zone";
        allow-update { none; };
};

zone "localhost." IN {
        type master;
        file "localhost.zone";
        allow-update { none; };
};

zone "0.0.127.in-addr.arpa." IN {
        type master;
        file "named.local";
        allow-update { none; };
};

zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa." IN {
        type master;
        file "named.ip6.local";
        allow-update { none; };
};

zone "255.in-addr.arpa." IN {
        type master;
        file "named.broadcast";
        allow-update { none; };
};

zone "0.in-addr.arpa." IN {
        type master;
        file "named.zero";
        allow-update { none; };
};

zone "domain.org" {
type master ;
file "db.domain.org";
allow-update {key "rndckey";};
notify yes;
};

include "/etc/rndc.key";

what's wrong, guys ?

kbp 02-09-2012 03:40 PM

Quote:

ignore client-updates
.. this might be a problem for a start, have you read 'man 5 dhcpd.conf'?

devilboy09 02-09-2012 03:59 PM

i'm configuring it based on this page:
http://www.techienote.com/2010/06/dy...on-centos.html

kbp 02-10-2012 12:52 AM

It won't affect the registration unless the host belongs to a different domain than that hosted by the dns server... there should be something in the logs .. ?

devilboy09 02-10-2012 01:12 AM

when i issue tail -f /var/log/messages i don't see nothing but this :
Code:

Feb 10 10:40:17 centos dhcpd: Dynamic and static leases present for 10.1.1.13.
Feb 10 10:40:17 centos dhcpd: Remove host declaration bt or remove 10.1.1.13
Feb 10 10:40:17 centos dhcpd: from the dynamic address pool for 10.1.1/24
Feb 10 10:40:17 centos dhcpd: DHCPREQUEST for 10.1.1.13 from 00:0c:29:a9:cd:96 via eth1
Feb 10 10:40:17 centos dhcpd: DHCPACK on 10.1.1.13 to 00:0c:29:a9:cd:96 via eth1

looks like ddns is not enable or something !

devilboy09 02-10-2012 02:44 AM

also i'm getting this error
Code:

grep named /var/log/messages
Feb 10 12:10:11 centos named[12371]: client 10.1.1.10#44061: updating zone 'domain.org/IN': update unsuccessful: bt.domain.org: 'name not in use' prerequisite not satisfied (YXDOMAIN)
Feb 10 12:13:03 centos named[12744]: client 10.1.1.10#55044: updating zone 'domain.org/IN': update unsuccessful: bt.domain.org/TXT: 'RRset exists (value dependent)' prerequisite not satisfied (NXRRSET)


devilboy09 02-10-2012 05:25 AM

i solved the problem.apparently when you register a record in named, manually, you can't update it with ddns.so i deleted the entries from zone database(in my case /var/named/db.domain.org) and now dhcp can update dns records.
but i have a question.when the client's record is updated, i can't see the entry in my zone for like a quit time.it seems there is a file with jnl extention in /var/named with same name as my zone database.what's the role of this file ?

kbp 02-11-2012 02:34 AM

That would be a journal .. see: http://www.zytrax.com/books/dns/ch7/xfer.html

devilboy09 02-11-2012 02:48 AM

thank you kbp.but i didn't undrestand the role of jornal file ?!?!

kbp 02-11-2012 06:00 AM

Quote:

Journal files are used by Dynamic DNS (DDNS) when modifying the master and when receiving IXFR changes on slave zones. The journal file is in binary format and its name is formed by appending the extension .jnl to the name of the corresponding zone file.

All changes made to a zone using dynamic update are written to the zone's journal file. The server will periodically flush the complete contents of the updated zone to its zone file this happens approximately every 15 minutes. When a server is restarted after a shutdown or crash, it will replay the journal file to incorporate into the zone any updates that took place after the last zone file update.
.. is this explanation ok ?

devilboy09 02-11-2012 06:36 AM

thank you so much


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