12 April 2016

Give your home web server a domain name on the web

If you want to host your own web server on the WWW from home, this tutorial will give you a static domain name if you have a dynamic ip address. I assume you have a device to act as a web server, like the RaspberryPi, and know how to forward ports.

Step one, sign up for a ydns account from https://ydns.io/. Google your ip address and input it in the static ip address field (don’t worry about the field being static for now).

Next install ddclient

sudo apt-get install ddclient

Ignore the setup screen for now, we’ll change that later.

Now sign up for an account at https://www.dnsomatic.com/. Select ydns from the list of providers when prompted.

With your account information, edit

sudo nano /etc/ddclient.conf

Have it look like

protocol=dyndns2
use=web, web=myip.dnsomatic.com
ssl=yes
server=updates.dnsomatic.com
login=your_dnsomatic_username_here
password='your_dnsomatic_password_here'
your_ydns_domain_name_here

This file should already be root only access so no need to chmod it to 600. Test everything went ok by running

sudo ddclient

and you should see your ip address output in the console.

Double check by checking the service page at dnsomatic (hit refresh page). Your current ip will now appear in the Status column and History file. Also check My Hosts in ydns, but if it fails only in ydns, it’s likely a configuration issue you made between dnsomatic and ydns.

ddclient will incremently contact dnsomatic if your ip address changes. dnsomatic will contact ydns if this happens too. This is how the static ip address entry in ydns becomes a more dynamic one.

One more note, if you want to change the default time the ddclient deamon activates to check your ip address (default is 300 seconds), the setting is in

sudo nano /etc/default/ddclient

I set mine to 600 (once every ten minutes).

No comments:

Post a Comment