What I want in a domain:
- Domain name for web site
- “Vanity” e-mail address
1&1 was the cheapest domain registration service I could find ($5.99/year, including private registration). The web is rife with complaints about their customer service (most notably, attempting to cancel an account), but I don’t plan to give up my domain, and I don’t use any of their services. I haven’t been a customer for that long, either. Buyer beware.
Their most basic service package includes web and e-mail hosting. I don’t care about the web hosting because I want to run the web site at home. Running a web site at home is simple enough. These instructions are specific for 1&1, but the concepts are applicable to any DNS provider.
Option #1: Configure the 1&1 domain to have its DNS delegated to FreeDNS or some other dynamic DNS provider. There are a few free dynamic DNS services listed at FreeDNS.com that will provide DNS for domains and subdomains. These services generally require some kind of client to be run at home that periodically updates their servers with a new IP address whenever it changes.
I’ve used both afraid.org and No-IP with my 1&1 domain; they both work fine. FreeDNS is very fully-featured, but the flexibility means it is necessarily slightly more complex to set up.
Once you’ve delegated away DNS for your domain, you can have vanity e-mail by setting up your DNS service to resolve your domain’s MX record to your home mail server; you use your ISP’s SMTP server to send e-mail, and you directly receive your e-mail on your home mail server.
The problem with such a 1&1 setup is that delegating away DNS for your domain also means foregoing the included e-mail hosting service. This bothered me. My web site is not really critical; in fact, its connectivity is completely dependent on my home ISP. However, I really don’t want my e-mail to bounce should my mail server be disconnected. So we move on to:
Option #2: Configure the 1&1 domain to be managed by 1&1′s DNS servers (default configuration). However, instead of hosting the domain’s web site with them, statically configure the domain name to resolve to your ISP-assigned dynamic IP address. Leave e-mail for the domain to be managed by 1&1. This is a supported configuration, and we now have reliably-hosted e-mail that we can retrieve with POP or IMAP.
However, there is now the task of making sure your changing IP address stays up to date in 1&1′s DNS service. 1&1 does not provide explicit support for dynamic DNS (e.g., no convenient update URLs like FreeDNS, and no background daemon like No-IP).
I used LiveHTTPHeaders to capture a trace of HTTP and HTTPS traffic while I manually navigated the 1&1 control panel. Armed with a trace of such network traffic, I wrote an automated client to masquerade as a web browser to automatically update the IP address associated with a 1&1 domain:
- Every 15 minutes or so, figure out your ISP-assigned IP address. This will most likely have to be a custom screen-scraper for your home router’s web interface (I’m not cool enough to run a Linux or FreeBSD router/firewall). Compare the current IP address with what was obtained last time. If it is the same, do nothing. If it has changed:
- Update 1&1 with the new IP address, using this
update1and1perl script; the script depends onlibwww-curl-perland needs to be customized with a 1&1 customer ID and password.
You may want to look into dedicated hosting. If you aren’t familiar with hosting on a dedicated server there are many articles you can read.
#1 by James Valentine on Mon Aug 13, 2007 - 9:01 am
Figuring out your ISP-assigned IP address doesn’t require screen-scraping your router. Why not simply host a script somewhere else that does what whatsmyip.org does? You can then poll that page from time to time to get your current IP. There are probably also other ways to do it: Skype sends a broken packet out of the network, and awaits it’s return a few milliseconds later (complete with external IP address).
Great idea, though!
J.
#2 by Joel d'ort on Wed Feb 25, 2009 - 5:02 pm
I’m a fan.
Very nice script. The only problem is the wait time on 1and1 site for the update to apply.
You are saving people money to do what dynadns and no-ip charge for…
thank you.
#3 by Fred Leon on Sun Mar 8, 2009 - 5:56 pm
Very nice script, but for me it does not seem to work well.
Perhaps could you tell me some information about why it doesn’t work.
When the script call the function GetDomain() an try to define $domainIds variable, it seem to failed and exit with this message:
Couldn’t find “mydomain.net”!
Is there a reason about that?
thank you.
#4 by Cory Walker on Wed Apr 15, 2009 - 11:44 am
You probably need to edit the settings. For me, I would change “mydomain.net” to “clustur.com”, because that is my website. You probably need to put in your password for 1 and 1, too.
#5 by John P on Mon Dec 28, 2009 - 2:18 pm
This is a very cool idea, just what I was looking for.
Does this still hold true to this date, 2 years after the original post, that 1&1 does not support any easier way of updating the DNS record? I do not want to use one of the free services for something like this when it seems there should be a simple solution I can do on my own, while retaining total control of my domain. (Kind of a control freak :-p)
I would like to use your Perl script, however I have two questions about it. Firstly, it seems to be far too complicated for performing such a simple task. Why is the script so bloated? Does it truly need so many lines?
Secondly, is this something that can be easily implemented into a home router running DD-WRT? I would prefer it to work this way so that I do not have to have a dedicated box constantly polling and writing the updated DNS entry to 1&1. Instead, my router (which is always on ANYWAY) could do the work for me- so long as the program isn’t too intensive for its little baby processor.