?
Solved

how to convert static zones to dynamic in ubuntu ddns linux

Posted on 2012-03-21
17
Medium Priority
?
827 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 29

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 29

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
 
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 2000 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

How to Create Failover DNS Record Sets in Route 53

Route 53 has the ability to easily configure DNS record sets specifically for failover scenarios. These failover record sets can be configured to failover to full-blown deployments in other regions or to a static HTML page that informs your customers of the issue.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I wrote this article to explain some important DNS concepts that should be known to avoid some typical configuration errors I often see in forums. I assume that what is described here is the typical behavior of Microsoft DNS client. I don't know …
I've written instructions for one router type, but this principle may be useful for others of the same brand and even other brands of router. Problem: I had an issue especially with mobile devices that refused to use DNS information supplied via…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

719 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