Page 1 of 1

DIY Dynamic DNS with GoDaddy...

Posted: Wed Jun 03, 2015 6:56 am
by pinback
Here's something cool I did this morning. Now I can easily host my GoDaddy domain names on my local box. If this sounds cool to you, here's how it's done:

1. Install python!
2. Install "pygodaddy" python module!
3. Make sure you have a static internal IP address!
4. Set your router to port forward port 80 (or whatever) to that static internal IP address!
5. Figure out how to screen-scrape your cable router for the external IP address, then write a little script to do it, as in:
#!/bin/bash

curl -su admin:yourpassword http://10.0.0.1/comcast_network.php | grep 'WAN IP Address(IPv4)' | tr -d '\n' | sed -e 's,.*<span>\([^<]*\)</span>.*,\1,g'
6. Write a little python script to use pygodaddy to update the DNS record, as in:
from pygodaddy import GoDaddyClient
import subprocess

client = GoDaddyClient()
if client.login("godaddyuser", "godaddypas"):
newip = subprocess.check_output("/usr/bin/wan") # this is the script quoted above
print "Updating moltobenny.com to " + newip
client.update_dns_record("moltobenny.com", newip)
else:
print "Unable to login."
So, after running that, now you can see that http://moltobenny.com is being hosted on my own little machine.

There ya go. Free dynamic DNS.

Re: DIY Dynamic DNS with GoDaddy...

Posted: Wed Jun 03, 2015 7:18 am
by Tdarcos
pinback wrote:5. Figure out how to screen-scrape your cable router for the external IP address, then write a little script to do it
Even easier, Google "my ip address" (quotes not needed) and the first result, in a highlight box, will be your i.p. v4 address (since you connect via ipv4), so you can scrape that and not even know the router access password.

Same thing for phones, dial 800 444 4444 and MCI's answering bot recording will read back the number you're calling from.

Re: DIY Dynamic DNS with GoDaddy...

Posted: Wed Jun 03, 2015 7:23 am
by pinback
Tdarcos wrote:
pinback wrote:5. Figure out how to screen-scrape your cable router for the external IP address, then write a little script to do it
Even easier, Google "my ip address" (quotes not needed) and the first result, in a highlight box, will be your i.p. v4 address (since you connect via ipv4), so you can scrape that and not even know the router access password.
Excellent tip, Mr. Taco!

Posted: Wed Jun 03, 2015 7:31 am
by Tdarcos
Thinking about this for a second, I'm surprised you'd have a dynamic DNS, I think the IP address Comcast assigned my router at home has been the same for at least the last 2-3 years. Maybe you don't use the Internet much and your DHCP lease is able to expire from lack of constant use?

Posted: Wed Jun 03, 2015 8:21 am
by pinback
I dunno, I just didn't want to leave it to chance. Plus it was a fun way to learn pygodaddy.

Posted: Wed Jun 03, 2015 8:52 am
by RealNC
If you have an Asus router, you can just enable the Asus DynDNS in it. All owners of an Asus router get that for free.

Posted: Wed Jun 03, 2015 10:26 am
by pinback
RealNC wrote:If you have an Asus router, you can just enable the Asus DynDNS in it. All owners of an Asus router get that for free.
Well, but I mean... if GoDaddy's hosting your domain's DNS records, what good does that do ya?