how to convert static zones to dynamic in ubuntu ddns linux

Dear Experts:

I am having DDNS server (ubuntu server) working as DDNS wherein as of now have static zones

 please help me how to  convert static zones tot the dynamic

Thanks in advance.
D_wathiAsked:
Who is Participating?
 
PapertripCommented:
I see you added update-policy local to the zone config for shriramdb.com, but that is not going to allow your DHCP server to update it.  If your DHCP server is configured to use the key ddns-key as you have in the zone config for dyn.shriramdb.com, then you need that allow-update statement instead of update-policy for shriramdb.com
        allow-update { key "ddns-key"; };

Open in new window


This will also require you to use ddns-key when updating the zone using nsupdate from the master server (or any server).  You can of course create a different key for use from the master as long as you add it to named.conf and to the allow-update option.
0
 
PapertripCommented:
Converting a zone to dynamic is straight forward to do and you should already have a similar config in place for your zones that are being updated by DHCPD.

Check out the allow-update and update-policy options at http://www.zytrax.com/books/dns/ch7/xfer.html#allow-update
0
WEBINAR: 10 Easy Ways to Lose a Password

Join us on June 27th at 8 am PDT to learn about the methods that hackers use to lift real, working credentials from even the most security-savvy employees. We'll cover the importance of multi-factor authentication and how these solutions can better protect your business!

 
Jan SpringerCommented:
The syntax is:

# nsupdate -y keyname:secret
    update add host.example.com 3600 A 192.168.1.1
    update add host2.example.com 3600 a 192.168.1.2
    update add 1.1.168.192.in-addr.arpa 3600 in ptr host.example.com
    update add 2.1.168.192.in-addr.arpa 3600 in ptr host2.example.com
    send

Make a comma delimited list of all of your forward and inverse addresses in this format with a sample filename of ddns.txt:

host.example.com,A,192.168.1.1
host2.example.com,A,1921.68.1.1
1.1.168.192.in-addr.arpa,in ptr,host.example.com
2.1.168.192.in-addr.arpa,in ptr,host2.example.com

Remove all of the static hosts in your zone files and reload your DNS server.

cat ddns.txt | while read line
  do
  set $line
  FIRST=`echo $line | cut -d "," -f1
  SECOND=`echo $line | cut -d "," -f2
  THIRD=`echo $line | cut -d "," -f3
  nsupdate -y keyname:secret
  update add $FIRST 3600 $SECOND $THIRD
  send
  quit
 done
0
 
PapertripCommented:
There is no need to recreate the zone using nsupdate, just add either allow-update or update-policy options depending on your needs to the zone config block and reload.
0
 
Jan SpringerCommented:
If the host already has an ip address assigned, it's past the ddns update stage in the dhcpd.conf file.
0
 
D_wathiAuthor Commented:
Please find the below /etc/bind/named.conf.local:

include "/etc/bind/rndc.key";
//include "/etc/bind/ddns.key";

controls {
        inet 127.0.0.1 port 953
                allow {127.0.0.1; } keys { "rndc-key"; };
};

zone "shriramdb.com" {
        type master;
        file "/var/cache/bind/db.shriramdb.com";
        update-policy local;
};
zone "1.168.192.in-addr.arpa" {
        type master;
        notify no;
        file "/var/cache/bind/db.1.168.192.in-addr.arpa";
        update-policy local;
};

zone "shriramproperties.com" {
        type master;
        file "/var/cache/bind/db.shriramproperties.com";
        update-policy local;
};

//## dynamic zones (updated by DDNS) ##

zone "dyn.shriramdb.com" {
        type master;
        file "/var/cache/bind/dynamic/db.dyn.shriramdb.com";
        allow-update { key "ddns-key"; };
};
-------------------------------------------------------------

After this i started adding entries like by executing
nsupdate -l

> update add gateway.example.local 38400 A 192.168.1.254
 >
 > update add 254.1.168.192.in-addr.arpa. 38400 PTR gateway.example.local.
 >
 > quit
-----------------------------------------

Please check my above config ,now tht waht ever entries made by entering nsupdate and add A and PTR records those have to be manually assigned to that particular host.

Please correct me if i am wrong. Thanks in advance.
0
 
PapertripCommented:
Please check my above config ,now tht waht ever entries made by entering nsupdate and add A and PTR records those have to be manually assigned to that particular host.

I'm not sure what you mean.  DHCP can still give out addresses to those hosts, but any zones that have update-policy local and/or do not have allow-update with ddns-key will not be updated by DHCPD.  

Is that what you are asking?
0
 
D_wathiAuthor Commented:
Sir, this is what exactly happening DHCP is still giving out the address to those hosts this has to be fixed, please tell me what to be done.
0
 
PapertripCommented:
Your DHCP server is not looking at the zone file before assigning IP's, it's only updating the zone with record from IP's that it does assign (as long as allow-update with the proper key is configured).

If you don't want specific addresses being handed out by DHCP you need to exclude them from the subnet declaration in dhcpd.conf.
0
 
D_wathiAuthor Commented:
HI, Sir , thanks for the reply,  I could observe even after assigning IP , Subnet, GW and DNS entries manually on to the host but the same host entries are not yet added to the static zones of NS in this case DHCP is assiging the IP to these host.

Please  suggest me  why this is happening. Please help.
0
 
PapertripCommented:
I'm not clear on what you are saying.

First you say that you manually assigned all the network info to the host, then you say DHCP is assigning it the IP?

Either you configure the client manually or you let DHCP take care of it... which are you doing?  What OS are these clients running?

In regards to configuring a host manually and then not seeing the changes reflected in the static zone, well that is because you are configuring it manually and not using DHCP to provide the network info and update a dynamic zone.
0
 
D_wathiAuthor Commented:
Sir,

i tried like extecuting like below

sudo cat ddns.txt | while read line
> do
> set $line
> FIRST=`echo $line | cut -d "," -f1
> SECOND=`echo $line | cut -d "," -f2
> THIRD=`echo $line | cut -d "," -f3
> nsupdate -l
> update add $FIRST 3600 $SECOND $THIRD
> send
> quit
> done

 ----------------------
terminal is not coming out from the loop  it stays > to come out should use CTL C
-------------------------------

Please suggse tme in this. Thanks in advance.
ddnstxt.txt
0
 
PapertripCommented:
Woops have to run will finish this reply later.
0
 
D_wathiAuthor Commented:
Hi sir , execute while and do statements for the attached zones after keying in done prompt does not come out it requires ctrl c.  Please help.
zone-forward.txt
zone-reverse.txt
0
 
D_wathiAuthor Commented:
Hi,  Papertrip sir as per previous post iam bringing this request, please help.
0
 
PapertripCommented:
Hey D,

Sorry man I just haven't had time to reply to this question.  The good news however is that I do now have time and will have a proper reply shortly.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.