DIY Dynamic DNS with GoDaddy...

Video Game Discussions and general topics.

Moderators: AArdvark, Ice Cream Jonsey

User avatar
pinback
Posts: 17849
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

DIY Dynamic DNS with GoDaddy...

Post 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.
Am I a hero? I really can't say. But, yes.

User avatar
Tdarcos
Posts: 9529
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: DIY Dynamic DNS with GoDaddy...

Post 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.
"Baby, I was afraid before
I'm not afraid, any more."
- Belinda Carlisle, Heaven Is A Place On Earth

User avatar
pinback
Posts: 17849
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: DIY Dynamic DNS with GoDaddy...

Post 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!
Am I a hero? I really can't say. But, yes.

User avatar
Tdarcos
Posts: 9529
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post 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?
"Baby, I was afraid before
I'm not afraid, any more."
- Belinda Carlisle, Heaven Is A Place On Earth

User avatar
pinback
Posts: 17849
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Post by pinback »

I dunno, I just didn't want to leave it to chance. Plus it was a fun way to learn pygodaddy.
Am I a hero? I really can't say. But, yes.

User avatar
RealNC
Posts: 2289
Joined: Wed Mar 07, 2012 4:32 am

Post 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.

User avatar
pinback
Posts: 17849
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Post 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?
Am I a hero? I really can't say. But, yes.

Post Reply