LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-24-2012, 01:09 PM   #1
gudlyf
LQ Newbie
 
Registered: May 2012
Posts: 2

Rep: Reputation: Disabled
Question DHCP/BIND and ddns to update two subnets


I have DHCP and BIND working fine to provide dynamic updates as we bring new servers online. I've got what might be a rather complicated setup beyond that which I'm hoping is possible without home-grown scripting.

We have two locations connected via VPN. Both locations use IPs in the 192.168.1.0/24 subnet. So, with the VPN, we map IP addresses such that to get to location1 we can hit 192.168.10.0/24 and to get to location2 it/s 192.168.20.0/24. Works great.

However, with the DHCP setup at location1, the DNS server there updates fine (let's say it put 'server1.domain.com' at 192.168.1.20), but we need to now get our DNS at location2 to know that 'server1.domain.com' is reachable at 192.168.10.20.

Right now we manually add the entries to the DNS server at location2. That's not very sustainable. Is what I'm trying to do possible?

Thanks!
 
Old 05-25-2012, 06:18 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
There's no way to tell the DHCP server to update the record for an entirely different IP address than the one it just assigned. Also, it is not possible to tell a DNS server to send mangled updates to a slave server.[1]

The main problem here is that you're using the same subnet at to different locations, and are using NAT to hack your way around the problem. If you have administrative control over both locations, switching the subnet at one of them should be no big deal.

[1]Actually, some Cisco equipment (ASA firewalls) has the ability to mangle DNS packets between NATed hosts, provided it's the Cisco equipment that does the NATing. It works for simple A record requests, not sure if it can handle DDNS updates or zone transfers (probably not). And signing DNS zones breaks this functionality anyway.
 
Old 05-25-2012, 12:58 PM   #3
gudlyf
LQ Newbie
 
Registered: May 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Not the most elegant solution, but this is working for us for now. Very hacky. Runs via cron every 5-10 mins:

Code:
#!/bin/bash

NSUPDATE='nsupdate -t 5'
DNSSERVER='192.168.60.79'

DNSCHANGES=$(grep -i "Added new forward map" /var/log/messages | grep map | grep "168" | awk '{print $11 ":" $13;}')

for i in $DNSCHANGES
do
  hostname=`echo $i | cut -d ":" -f 1`
  ip=`echo $i | cut -d ":" -f 2 | sed 's/192\.168\.1/192\.168\.50/'`
  COMMANDS="
server $DNSSERVER
key coloupdate blahblahblahkeyhere
zone ourdomain.com
update delete $hostname
update add $hostname 1 A $ip
send"
echo -e "$COMMANDS" | $NSUPDATE
done
 
Old 05-25-2012, 02:33 PM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
Quote:
Originally Posted by gudlyf View Post
Not the most elegant solution, but this is working for us for now. Very hacky. Runs via cron every 5-10 mins:
Nice. Adds a whole new dimension to the concept "zone transfers". Although you could probably have reconfigured one of the subnets in less time than it took to write that script.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCP DDNS BIND: dhcpd not doing its share of the lifting dick.swift Linux - Server 1 05-06-2009 09:05 AM
bind and DHCP - DDNS kudos Linux - Networking 7 06-15-2008 04:12 AM
How to update Windows DDNS server by Linux DHCP server Zebrastreifen Linux - Networking 1 08-02-2006 05:19 PM
DDNS Bind 9.0 / DHCP - mule Linux - Networking 2 01-06-2006 11:55 PM
configure bind ddns dhcp on Slackware djchris Linux - Networking 1 12-24-2004 02:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration