by pinback » Wed Jun 03, 2015 6:56 am
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:
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.
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:
[quote]
#!/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'
[/quote]
6. Write a little python script to use pygodaddy to update the DNS record, as in:
[quote]
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."
[/quote]
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.