Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: DDNS with NSD3?
PostPosted: Sat Jun 29, 2013 7:56 pm 
Offline
Senior Member
User avatar

Joined: Thu Jun 16, 2011 8:24 am
Posts: 412
Location: Cyberspace
I've already seen the other threads regarding DDNS on Linode, however the general consensus is to use Linode's API. Problem is, I am hellbent on running my own DNS, partly because I'm paranoid, and partly because I'm a hard core DIYer.

I've done some searching around on Google for this, and so far the solutions I've are to either use some other NS daemon with built-in or to use a server-side Perl script for BIND to update via cron (how does that work? :? ). Since I've gotten NSD3 already working nicely, and it seems otherwise capable of fulfilling my needs, I don't want to risk switching -- why fix what's not broke?

Question is: is it possible for novice coder like me (who can barely combine PHP's if/else and echo with HTML/CSS) to make this happen, e.g. have a web page or a daemon on my 'Node that I can ping from my laptop to make the update happen? I'm sure I could write a crude PHP page that'll do it -- problem is securing it while still allowing it to be automated. With my limited experience, I'd end up using HTTP GET to send a user/password combo -- not very secure at all :wink:

_________________
Kris the Piki Geeker


Top
   
 Post subject: Re: DDNS with NSD3?
PostPosted: Sat Jun 29, 2013 8:20 pm 
Offline
Sysop

Joined: Sat Nov 27, 2010 3:32 am
Posts: 180
Website: https://blog.timheckman.net/
Location: San Francisco, CA
You could use a private repo on bitbucket for this. You could then write a quick Python script, for example, to check if your repo has had any updates (recently) and then have it 'git pull'.

You could also write a cron job to just pull every so often and reload nsd3.

Or just a big for loop that SSHes in and does the needful.

-Tim

_________________
'If debugging is the process of removing bugs, then programming must be the process of putting them in.' //Edsger Dijkstra
'Nothing is withheld from us which we have conceived to do.' | 'Do things that have never been done.' //Russell Kirsch


Top
   
 Post subject: Re: DDNS with NSD3?
PostPosted: Sat Jun 29, 2013 8:26 pm 
Offline
Junior Member
User avatar

Joined: Fri May 04, 2012 8:57 pm
Posts: 49
Piki wrote:
e.g. have a web page or a daemon on my 'Node that I can ping from my laptop to make the update happen?



single-packet auth for dynamic DNS? there's an idea!

_________________
me | voltaireMC


Top
   
 Post subject: Re: DDNS with NSD3?
PostPosted: Sat Jun 29, 2013 11:44 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
I have a very simple CGI script that I call from my workstation every 5 minutes:
Code:
#!/usr/bin/perl

use Socket;

my $r=$ENV{'REMOTE_ADDR'};
$r=~s/^::ffff://;

print "Content-Type: text/plain\n\n";
print "You are: $r\n";

$host="my.dns.name";

@name=gethostbyname($host);
$ip=inet_ntoa($name[4]);

print "$host: $ip\n";


That'll return the value stored in DNS and the value of the client. In my case the client controls my own DNS server locally (linode is a slave server), but it'd be simple for this code to to compare $ip to $r and if it was different then perform a DNS update, depending on how you implement your DNS update code.

The client machine effectively then does a "wget http://my.server/dynamic_ip.cgi" via cron every 5 minues.

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group