I work remotely so being able to connect to my work hardware is important, especially when I need powerful hardware like that used for deep-learning. I’ve found that using a personal domain for an alias to be incredibly useful as :
- Domains are easier to to remember than IP addresses (
- Domain names stay the same. IP addresses change, especially those issued by consumer Internet Service Providers.
- Using a domain allows for the registration of SSL certificates for webapps. See my guide on setting up JupyterHub and Tensorboard with SSL as an example. SSL certificates are important because it’s what enables you to communicate securely over HTTP. Without a domain, you can still use SSL but you’ll need to deal with self-signed certificates which are confusing to configure and won’t show as valid by default in browsers.
- This guide uses Ubuntu 16.04.3 LTS, though any linux/unix distribution would work.
- Ensure necessary ports have been forwarded on your router.
- I use google domains. You can use other domain registration services, but the instructions will differ slightly.
Configuring a custom subdomain
- Select the servers tab.
- Create a synethetic record.
- Select Dynamic DNS.
- Create a subdomain you want to use as an alias to your home server. In my case,
- Make note of your username and password. You’ll use this later to configure the
Configuring dynamic DNS for IP updates
sudo apt-get install ddclient
Edit your ddclient configuration file.
sudo vi /etc/ddclient.conf where
xxx.bdd.io is your domain and the login and password are the same from the steps above. IMPORTANT passwords must be surrounded by single quotes in the configuration file.
# /etc/ddclient.conf protocol=dyndns2 use=web server=domains.google.com ssl=yes login=xxxxxxx password='xxxxxxxxxx' xxx.bdd.io
Check to make sure your client succesfully updates it’s record.
sudo ddclient -daemon=0 -debug -verbose -noquiet
... ... SUCCESS: xxx.bdd.io: : IP address was set to 220.127.116.11. SUCCESS: yyy.bdd.io: : IP address was set to 18.104.22.168.
Now go ahead and check your google domains dashbaord to make sure it now has your correct IP address.
Sometimes DNS changes can take several hours to propogate.
Congratulations! You should now be able to access your remote machine via a handy-dandy subdomain!