nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

How to update DNS through DHCP automatically

This is a discussion on How to update DNS through DHCP automatically within the Shell scripting forums, part of the Development/Scripting category; Hello friends, I am trying to Update DNS automatically when DHCP server leases any new address , but I am ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 03-15-2005, 08:19 PM
Junior Member
User
 
Join Date: Jan 2005
Posts: 19
Rep Power: 0
sonaikar
Default How to update DNS through DHCP automatically

Hello friends,

I am trying to Update DNS automatically when DHCP server leases any new address , but I am not getting it done.

I would like to know the procedure.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-16-2005, 07:42 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Do you want perl/shell script or what? as you posted it in Shell scripting forum...
If you are looking for configuration then you need it as follows:

Let us say domain is test.com

Domain nameserver, dns (named), samba and most of Linux services servers ip is 192.168.0.1

And network is 192.168.0.1/24 for dhcp ips are 192.168.0.10-60

Your dhcpd.conf should be as follows (use DHCP Server version 3 or above)
Code:
ddns-updates on;
ddns-domainname "test.com";
option ntp-servers 192.168.0.1;
ddns-update-style ad-hoc;
allow unknown-clients;
default-lease-time 86400;
max-lease-time 172800;

option domain-name "test.com";
option domain-name-servers 192.168.0.1;
option netbios-name-servers 192.168.0.1;
option netbios-dd-server 192.168.0.1;
option netbios-node-type 8;

subnet 192.168.0.1 netmask 255.255.255.0 {
	range dynamic-bootp 192.168.0.10 192.168.0.60;
	option subnet-mask 255.255.255.0;
	option routers 192.168.0.220;
	allow unknown-clients;
}

In your named.conf file it should be as follows:
Code:
acl lan {
	192.168.0.1/24;
	127.0.0.1;
};

options {

	directory "/var/named";
	listen-on-v6 { any; };
	notify no;
	forward first;
	forwarders {
		192.168.0.254;
		};
	auth-nxdomain yes;
	multiple-cnames yes;
	listen-on {
		lan;
		};
};

zone "test.com" {
	type master;
	file "/var/named/test.com.zone";
	allow-query {
		lan;
		};
	allow-transfer {
		lan;
		};
	allow-update {
		lan;
		};
	};

zone "0.168.192.in-addr.arpa" {
	type master;
	file "/var/named/192.168.0.rev.zone";
	allow-query {
		lan;
	};
	allow-transfer {
		lan;
	};
	allow-update {
		lan;
	};
};

Now restart the both and see if it works or not... also visit http://ops.ietf.org/dns/dynupd/secure-ddns-howto.html
http://www.wlug.org.nz/DHCPNotes

Hope this helps
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Update Password File amsreeku Linux software 2 03-02-2008 08:02 PM
single DHCP server with multiple VLAN's frank Computer Networking and Internet/broadband 2 12-07-2007 01:38 PM
connecting to a DHCP network ricc Linux software 2 04-24-2006 01:46 PM
DHCP server aindusekhar Linux software 1 09-13-2005 07:29 PM
Dynamic DNS , should get updates automatically from DHCP sonaikar Linux software 1 03-28-2005 01:14 PM


All times are GMT +5.5. The time now is 07:37 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36