User Name
Password
AppleNova Forums » AppleOutsider »

End of an era... my dynamic DNS


Register Members List Calendar Search FAQ Posting Guidelines
End of an era... my dynamic DNS
Thread Tools
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2022-12-19, 14:29

I've had the same dyndns.org hostname for ever. Way back when Linksys worked with them and allow me to host images out of my house rather than a hosting service.

Nowadays I don't need it. I've learned how to script A Record changes with crons to keep up with my ISP changing my IP. Then again, my IP doesn't even change now given I have a static block for now.

I don't recall how far back this domain of mine goes, but I know it is easy in the early 2000's. I might even dig through my oldest posts and look for an image I linked to that is now defunct. I'm sure this place is one of the early ones I shared a link to that hostname.

Now DYN was bought by Oracle and stopped offering the free tier. Because I was with them for so long they gave me premium for free for a few years. That is over now and I just don't think I want to renew just to hold onto that hostname.

I will say though, I think this is one of my oldest and longest running internet services I've had. Likely 20 years! Holy crap that seems so long thinking about it.

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.”
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2022-12-19, 18:03

FWIW, I also used to use DynDNS starting long ago, but I switched to DuckDNS many years back, probably when Oracle bought Dyn (2016?). My home IP rarely changes now that I'm on Google Fiber (I'm not sure if it's ever changed, actually), but since they don't strictly guarantee a static IP address, I trust my DuckDNS name to find my home network when I'm remote.

Maybe I should figure out DNS scripting some day too. Do you have any pointers or specific instructions you followed for your current setup?

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2022-12-19, 20:24

Yep, I'll share what I've done!

First was host a simple site that returned your external IP address. I've done it with general web hosting and even Azure with some of their free services. Since you have the AN server I would just put it in here if I were you.
Put this as "ip.php" on your server somewhere so you can curl it:
Code:
<?php echo $_SERVER['REMOTE_ADDR']; ?>
Then it returns your IP like this:
Code:
RackMini:~ turtle$ curl https://mydomain.com/ip.php 192.168.1.19RackMini:~ turtle$
Then it is a matter of using your DNS provider's API calls.

My cron is run every five minutes and the script is something like this one:
Code:
#!/bin/bash # Get IP address of home and update dns.he.net for my domain.com # This is in sudo crontab # Get and set current home IP and previous logged one from file homeIP=`curl -4 -sS http://anmc.com/ip.php` oldHomeIP=`cat /home/turtle/mydomain.com.ip` # Check if the home IP has changed if [ "$oldHomeIP" != "$homeIP" ] then curl -4 -sS "http://mydomain.com:744urXXXXXXXXOfV@dyn.dns.he.net/nic/update?hostname=mydomain.com" && echo echo "`date +%Y-%m-%d` `date +%H:%M:%S` - $homeIP # Home IP updated with dns.he.net" >> /var/log/ipchange.log echo $homeIP > /home/turtle/mydomain.com.ip fi # Unset variables unset homeIP; unset oldHomeIP
I did it this way so I'm not relying on any one else's services. Sure I host the ip.php somewhere public, but I have that so it is easy to do. Again, Azure will allow you to host a simple php page and use a public "ugly" URL to pull it if you don't have access to a public web server. So the cron runs this script. That script takes a look at a saved file that contains the previous IP address. It then curls the ip.php site for the current external IP of your home (running this from a server in your home of course) and then compares that IP to the previous IP. If they are different then it executes the API call to change the IP of your hostname.

I was using Hurricane Electric DNS until this past week so this worked for me. (I've since moved to Cloudflare DNS.). Who ever hosts your domain should have API calls that can be made though allowing the update process to be completely in house. No need to run another services or anything.

Of course, with dyndns.org I used a slightly different method:
Code:
creds=$(cat /root/dyndns/creds) curl -v -k -u $creds "https://members.dyndns.org/nic/update?hostname=dynhost.getmyip.com&myip=$homeIP"
This way gave me a file to update for the credentials as needed.

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.”
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.

Last edited by turtle : 2022-12-20 at 16:55.
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic iPhone Lock Screen feidhlim1986 Genius Bar 1 2008-08-13 17:15
Dynamic View New Posts viewing? Fahrenheit Feedback 9 2006-10-03 10:36
Linker option to get dynamic library (apart from -shared ) kate Programmer's Nook 3 2006-08-10 07:41
Dynamic Assignation vs. Stable URL drewprops Programmer's Nook 9 2005-12-11 18:25
Dynamic IP VPN providers? awilso Third-Party Products 8 2005-10-11 06:36


« Previous Thread | Next Thread »

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


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova