nixCraft Linux Forum

nixCraft

Linux / UNIX 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

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 15-03-2005, 07:19 PM
Junior Member
User
 
Join Date: Jan 2005
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
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
  #2 (permalink)  
Old 16-03-2005, 06:42 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
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


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 Off


Similar Threads

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


All times are GMT +5.5. The time now is 02:37 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

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 37 38