Poor man's dynamic DNS for reverse tunnel

General discussions and other topics.
7 posts Page 1 of 1
by lr » Thu Dec 11, 2014 6:08 pm
We're long time satisfied Sonic customers, but only for hosting. Because of our location, the only reasonable bandwidth provider is DSL from our local phone company Verizon (no, it is not possible to switch to Sonic, as much as we would love to). Sonic handles our e-mail, hosts the public web site, and does DNS for our domain.

At home, we know have a DSL modem, which interestingly has the capability of tunneling a few ports back. I use that to directly access our server at home from anywhere in the world (obviously, with all the usual security features: only SSL-protected protocols, obscure port numbers, strong passwords). Our DSL modem has a dynamic IP address, and we can not get static addresses for a sane amount of money from Verizon. The way I have set this up: Using the member tools on Sonic's website, I added an A record to the DNS for our domain (let's call it ourmodem.mydomain.org), and gave it the IP address that Verizon assigns to our DSL modem. I even wrote a few scripts, one that runs on my server at home and determines the IP address of our modem regularly, another one that deposits that IP address and a time stamp on bolt.sonic.net every 10 minutes (to verify that the IP address hasn't changed, and that the DSL link going home is still alive), and a cron job that runs on bolt regularly that checks whether the DSL link is down or the IP address is wrong, and if yes, sends me an e-mail.

So far, so good. This gives me the ability to access the server at home (admittedly, at low bandwidth). And because it has a real DNS name, it's even super convenient: Just point a web browser to it (with some strange port numbers and the need for a password), and you're there. Or ssh into it.

Now it gets a little hairy. Even though we have a dynamic IP, for over a year Verizon never changed our IP address, and this setup didn't require any babysitting. But since the beginning of this rainy season, our IP address changes every time there is a power outage at the DSLAM (which phone-company end of the DSL line), and those power outages have been annoyingly frequent, about once a week. And every time this happens, I end up getting a warning e-mail from my monitoring scripts telling me that our home server is unreachable, pointing out that the DNS name doesn't match the IP address, and then I bring up the Sonic member tools, update the DNS, wait 10 minutes, and everything is back to normal. This is really not a big hassle, just 5 minutes about once a week. But wouldn't it be nice to automate this?

In reality, what I'm doing here is poor man's dynamic DNS. Early on, when I didn't have to change it for over a year, it wasn't very dynamic. Even then, it is slightly immoral to serve DNS for an IP address that is not in the control of our domain (which for example implies that the reverse DNS for that IP address doesn't match the host name, but I guess that has been accepted these days). I also hope that the powers that be who administer bolt are OK with me depositing a file there and running a tiny cron job every 10 minutes.

Is there a sane way to automate it? Sure, I could find a random dynamic DNS provider. But I hear that there are no good free ones left. And going with a third-provider would mean that I don't get the convenient .mydomain.org address. So let's stay with using Sonic's excellent DNS for all things in my domain, even the reverse tunnel. I could also write some complicated scripts using some web development toolkit that access Sonic's member tool web page, and automate updating that one IP address in the DNS settings. This is (a) a lot of work for a rare problem, (b) has nasty failure possibilities (one little bug, and I do wholesale destruction of DNS), and (c) I'm not sure Sonic would like it if an automated bot uses as web page that's clearly designed for humans.

Any good ideas on what to do? By the way, a sensible option is "do nothing and live with the slight inconvenience".

Also: I'd love to hear from Sonic staff that it's OK with them to use *their* DNS server for an IP address that's not under their control (namely my Verizon modem), and that's OK for me to manually change that IP address somewhat regularly?
Linda and Ralph and John; 735 Sunset Ridge Road; Los Gatos, CA 95033; 408-395-1435
by Guest » Thu Dec 11, 2014 6:27 pm
https://freedns.afraid.org

They have a wide variety of domains. They even include scripts for you to update your IP: direct URL, wget, and curl. The only thing you need to do is to not abuse their system by constantly sending non-changing requests. Look at snmpwalk to retrieve your firewall's/router's WAN IP and update when appropriate.
by kgc » Fri Dec 12, 2014 12:36 pm
You could always use our Dynamic DNS service.

https://wiki.sonic.net/wiki/DynamicDNS
Kelsey Cummings
System Architect, Sonic.net, Inc.
by Guest » Fri Dec 12, 2014 12:50 pm
kgc wrote:You could always use our Dynamic DNS service.
I thought this only works if we have a host registered with Sonic. With freedns.afraid.org, it's totally free.
by kgc » Fri Dec 12, 2014 1:56 pm
It works so long as you have a domain with sonic.
Kelsey Cummings
System Architect, Sonic.net, Inc.
by lr » Fri Dec 12, 2014 9:43 pm
kgc wrote:You could always use our Dynamic DNS service.
How excruciatingly boring. Just looked at the documentation, and tested a few simple things. This is going to be trivial but a little tedious to implement. I like that you can get your own IP address, that was thoughtful to add.

During the Christmas vacation, I'll write a few scripts that use that, and put some safeties around it (for example, only update it once in each 24 hour period, and if it changes more often, give up and send an e-mail to the admin).

Thank you!
Linda and Ralph and John; 735 Sunset Ridge Road; Los Gatos, CA 95033; 408-395-1435
by kgc » Sat Dec 13, 2014 12:38 pm
We'd always hoped that someone would release a windows tray app to support it.
Kelsey Cummings
System Architect, Sonic.net, Inc.
7 posts Page 1 of 1

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 3 guests