Thursday, August 30, 2007

EditDNS Howto in Kubuntu

I've been using EditDNS' services for a couple of months now, and I'm happy it's reliable. However, few people has asked me how to go about setting it up on a system with Dynamic IP address, and walking them through setting it up has consumed much of my time. That's why I'm writing this little howto.

Requirements:

  • you have Web Server installed. This may be Apache or Lighttp. Of course, assuming you wanted a web server. If you intend to use it for to host IRC, SVN, POP3, IMAP, etc. then you should have a server application for that as well.
  • your system should be accessible from the outside network. Try surfing to your IP address. If you don't know your IP address, go to http://whatismyip.com/. Also, just to make sure, ask a friend to surf using your IP address too.
  • if you can't access your PC from the outside, try checking your firewall. Better yet, disable it for the mean time.
  • if you still can't access your PC even with firewall disabled, check your router. Configure to forward port 80 (again, assuming you're setting up a web server) to your system. Check your router documentation, and please don't ask me.
  • get an account with EditDNS. There's no sense following this article if you don't have one.
  • if you have a domain, contact your domain provider regarding changing your Nameserver.
Instructions for Adding a Domain:
1. Login to EditDNS and skip the Help Us Spread the Word page.

2. Login to your domain provider's Control Panel and point the nameservers to:
  • ns1.us.editdns.net
  • ns2.us.editdns.net
  • ns3.us.editdns.net


3. Add a domain.. that is, if you have one. We'll go through adding a Sub-Domain later.



4. Add a DynDNS Record



5. On the Dynamic DNS Record Page, type in a password then place a check mark on your two domains listed below. Leave the "New DynRecord record (Optional):" blank. Click the Add button.



6. Verify settings.



7. Now check if it'll update by going to this website:

http://dyndns.editdns.net/api/dynLinux.php?p=password&r=knightlust.com

Please make sure you change the password and the knightlust.com with your details.



It should have one entry: Record has been updated. Now do the same thing for the other domain.

http://dyndns.editdns.net/api/dynLinux.php?p=password&r=www.knightlust.com

8. Get back to the EditDNS page and refresh it. Make sure the IP/Host is also updated. If it's updated, then you know it's working.



9. Install lynx, you don't need it, but the next step does.

sudo aptitude install lynx

10. Create a text file with the following entries:

#!/bin/bash
lynx -source "http://dyndns.editdns.net/api/dynLinux.php?p=password&r=knightlust.com" lynx -source "http://dyndns.editdns.net/api/dynLinux.php?p=password&r=www.knightlust.com"

Save the text file as editdns. We need this so it'll update EditDNS records every time you reboot or start this computer.



11. Move the editdns file to /etc/init.d

sudo mv editdns /etc/init.d

12. Create a symbolic link to /etc/rcS.d

sudo ln -s /etc/init.d/editdns /etc/rcS.d/S90editdns

Notes:
- Wait for at least 4 hours for your domain to propogate. Don't expect it to work right after setting it up.
- You may also add No. 10 to your crontab, instead of placing it into /etc/init.d and /etc/rcS.d.
- If your ISP changes your IP address while online, you don't have to reboot your system. Just issue the command:

sudo /etc/init.d/editdns

Instructions for Adding a Sub-Domain:

1. Login to EditDNS and skip the Help Us Spread the Word page.

2. Type in a sub-domain that you want. Then click the Add button



3. Click the left [x] to modify it. And don't mind the "You currently don't have any domain names." message, I think it's a bug.



4. Add a new DynRecord.



5. Enter a password and place a check mark on your Record Name, just below the Add column. Then click the Add button.



6. Verify Settings.



7. Now check if it'll update by going to this website:

http://dyndns.editdns.net/api/dynLinux.php?p=password&r=dax.mydyn.net

Please make sure you change the password and the dax.mydyn.net with your details.



8. Get back to the EditDNS page and refresh it. Make sure the IP/Host is also updated. If it's updated, then you know it's working.



9. Install lynx, you don't need it, but the next step does.

sudo aptitude install lynx

10. Create a text file with the following entries:

#!/bin/bash
lynx -source "http://dyndns.editdns.net/api/dynLinux.php?p=password&r=dax.mydyn.net"
Save the text file as editdns. We need this so it'll update EditDNS records every time you reboot or start this computer.



11. Move the editdns file to /etc/init.d

sudo mv editdns /etc/init.d

12. Create a symbolic link to /etc/rcS.d

sudo ln -s /etc/init.d/editdns /etc/rcS.d/S90editdns

Notes:
- Wait for at least 4 hours for your domain to propogate. Don't expect it to work right after setting it up.
- You may also add No. 10 to your crontab, instead of placing it into /etc/init.d and /etc/rcS.d.
- If your ISP changes your IP address while online, you don't have to reboot your system. Just issue the command:

sudo /etc/init.d/editdns

Additional Notes:
It is not required to have a DynRecord for knightlust.com and www.knightlust.com. A single DynRecord for knightlust.com is enough. Just make sure to CNAME www.knightlust.com. If you choose this option, then you may remove the second entry from /etc/init.d/editdns.

Blogged with Flock