Solved

how to convert static zones to dynamic in ubuntu ddns linux

Posted on 2012-03-21
17
801 Views
Last Modified: 2012-06-21
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.
0
Comment
Question by:D_wathi
  • 9
  • 6
  • 2
17 Comments
 
LVL 21

Expert Comment

by:Papertrip
ID: 37748614
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
 
LVL 21

Expert Comment

by:Papertrip
ID: 37748659
0
 
LVL 28

Expert Comment

by:Jan Springer
ID: 37748698
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
 
LVL 21

Expert Comment

by:Papertrip
ID: 37748810
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
 
LVL 28

Expert Comment

by:Jan Springer
ID: 37748847
If the host already has an ip address assigned, it's past the ddns update stage in the dhcpd.conf file.
0
 

Author Comment

by:D_wathi
ID: 37748973
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
 
LVL 21

Expert Comment

by:Papertrip
ID: 37749024
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
 

Author Comment

by:D_wathi
ID: 37749066
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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 21

Expert Comment

by:Papertrip
ID: 37749102
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
 

Author Comment

by:D_wathi
ID: 37751951
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
 
LVL 21

Expert Comment

by:Papertrip
ID: 37764349
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
 

Author Comment

by:D_wathi
ID: 37807042
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
 
LVL 21

Expert Comment

by:Papertrip
ID: 37807063
Woops have to run will finish this reply later.
0
 

Author Comment

by:D_wathi
ID: 37810278
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
 

Author Comment

by:D_wathi
ID: 37815221
Hi,  Papertrip sir as per previous post iam bringing this request, please help.
0
 
LVL 21

Expert Comment

by:Papertrip
ID: 37818136
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
 
LVL 21

Accepted Solution

by:
Papertrip earned 500 total points
ID: 37818200
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

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

A Cisco router can be configured as a DHCP Server. There are advantages and disadvantages in making your Cisco router work as DHCP Server. Almost all the features for windows DHCP can be configured on Cisco-based DHCP server. Some of the features me…
Configuring network clients can be a chore, especially if there are a large number of them or a lot of itinerant users.  DHCP dynamically manages this process, much to the relief of users and administrators alike!
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now