Setting up Dynamic DNS on MyDNS.jp Using a Domain Acquired via Onamae.com
This time, I took on the challenge of configuring a custom domain obtained through Onamae.com to be used as a Dynamic DNS (DDNS).
While Onamae.com does provide a Dynamic DNS service, I used MyDNS.jp instead of Onamae.com’s built-in Dynamic DNS because I wanted to use a tool called ddclient.
}
I’ll introduce the step-by-step procedure in detail!
For details on the machine used, please check the following article.
Getting an Ubuntu Machine Using OCI (Oracle Cloud Infrastructure) Always Free
Acquiring a Domain on Onamae.com
First, I acquired a custom domain on Onamae.com.
- As an example, I purchased the domain “example.com".
Although Onamae.com offers a Dynamic DNS service, ddclient does not support it.
Therefore, I chose MyDNS.jp as the update destination for Dynamic DNS.
Configuring Dynamic DNS Using ddclient
I used a tool called ddclient to update the Dynamic DNS. I set up the environment with the following steps.
1. Install ddclient
- The environment used is Ubuntu 22.04. ddclient can be installed from the standard repository.
sudo apt update sudo apt install ddclient
2. Introduce the unofficial ddclient
- The standard version of ddclient does not support the MyDNS.jp update protocol. By using an unofficial version created by a volunteer, integration with MyDNS.jp becomes possible.
Get it from here. Much appreciated!~ - Overwrite the official version of ddclient with the unofficial version:
sudo cp {非公式版ddclientのパス} /usr/sbin/ddclient
3. Fix the location of ddclient.conf
- Introducing the unofficial version changes the path of the configuration file, so I fixed it with the following steps:
sudo mkdir /etc/ddclient sudo ln -s /etc/ddclient.conf /etc/ddclient/
4. Configure MyDNS.jp Nameserver Settings
- I changed the DNS settings for the domain acquired on Onamae.com to MyDNS.jp. This enables IP updates through MyDNS.jp.
5. Configure ddclient.conf
- Added the following content to
/etc/ddclient.conf:ssl=no protocol=mydns server=ipv4.mydns.jp use=web, web=checkip.dyndns.org/ web-skip='IP Address' login={mydnsのログインID} password={mydnsのログインパスワード} {お名前.comで取得したドメイン}
Operation Check and Adjustment
1. Check and Delete Cache
- IP address caches are saved in
/var/cache/ddclient/ddclient.cache. Deleting this file during testing makes it easier to check the update status:sudo rm /var/cache/ddclient/ddclient.cache
2. Verify IP Update
- By default, ddclient checks and updates the IP address every 300 seconds.
- Access mydns.jp to check if the IP has been updated. If it looks like the following, you’re good to go:
DNS UPDATE : {お名前.comで取得したドメイン名}IPv4 UPDATE : {mydnsのログインID} {IPアドレス} (?), http, la01
- Locally, the updated content is reflected in
ddclient.cache, so you can check it with the following command:cat /var/cache/ddclient/ddclient.cache
3. Run ddclient as a Daemon
- Once the update is successful, run ddclient as a resident background process:
sudo systemctl enable ddclient sudo systemctl start ddclient
Conclusion
I built a Dynamic DNS setup using a domain acquired from Onamae.com, combined with MyDNS.jp and ddclient!
- Key Points:
- Although Onamae.com supports Dynamic DNS, it is incompatible with ddclient, hence the use of MyDNS.jp.
- Using an unofficial ddclient makes MyDNS.jp updates possible.
- Minor tasks such as fixing configuration file paths and deleting caches are required.
As a result, I was able to automate IP address updates and build a comfortable environment. If you are considering running Dynamic DNS for a similar purpose, please give it a try.
Also, please let me know in the comments if you have any questions or feedback!