set up DDNS with ddclient & Google Domains

2022/08/27閱讀時間約 4 分鐘

Introduction

To set up DDNS, you should set the DDNS record on your domain name registrar first. Then send the DDNS and IP settings from your server to your domain name registrar.

Set DDNS on Google Domains

To set your DDNS record on Google Domains, just follow this document.

ddclient

To send the DDNS and IP settings from your server to your domain name registrar, we would use ddclient.

installation

Since I use mac, let’s take it as an example. Using Homebrew to install it.
brew install ddclient

ddclient.conf

Let’s create a directory called `ddclient` in `/opt/homebrew/etc/` , and create `ddclient.conf` in `/opt/homebrew/etc/ddclient` .
`daemon` is to set the interval in how many seconds the ddclient would check your IP and update. Google Domains follow the `dyndns2` protocol. `server` is your domain name registrar. When you set the DDNS record on your domain name registrar, it would give you the username and password of this DNS certification. Finally, write your domain in the last line.

multiple domains

To set multiple domains in `ddclient.conf` , just set the different DNS settings after the previous one.

start/restart manually

After updating the `ddclient.conf` , you should restart the ddclient. Actually, it would auto start every few minutes. You can just leave it if you are lazy.
sudo ddclient

Auto start

If you use `brew` to install ddclient, it already set it started at boot.

Manually update DDNS by google domain API

Also, you can update your IP for your DDNS by this API.
https://username:[email protected]/nic/update?hostname=subdomain.yourdomain.com&myip=1.2.3.4
為什麼會看到廣告
張哲嘉
張哲嘉
I'm a full-stack engineer in Senao Networks. Vue/Django/MongoDB/Nginx
留言0
查看全部
發表第一個留言支持創作者!