type
status
date
slug
summary
tags
category
icon
password
Previously, I introduced how to achieve coexistence between OpenClash and IPv6 on OpenWRT. Not only does the main router have a public IPv6 address, but all clients also have unique public IPv6 addresses. With IPv6, we can do many things, such as remotely managing the home network, remote streaming over the public network, using Emby media servers over the public network, and setting up our own DNS servers, among others. Most DDNS tutorials currently only explain how to obtain the IPv4 and IPv6 addresses of the device where the plugin is located and how to bind them with DDNS domain names. Today, I will share how to install and configure DDNS-GO on a bypass gateway to bind domain names for devices in the local network that require them through IPv6 addresses.
DDNS (Dynamic Domain Name System) is a service that allows users to automatically update DNS records when their IP addresses change. Typically, Internet Service Providers (ISPs) assign dynamic IP addresses to home or small office networks, which means the IP addresses will change periodically. If you run a service that needs to be accessed from the outside world (such as a home server or gaming console), changes in IP addresses can make your service inaccessible.
The working principle of DDNS is as follows:
- Dynamic IP Monitoring: DDNS client software runs on your device and regularly checks if your public IP address has changed.
- Updating DNS Records: When an IP address change is detected, the client automatically updates the new IP address to the DDNS service provider's DNS server.
- Domain Name Resolution: External requests are resolved to your current IP address through the domain name provided by the DDNS service, ensuring that your service remains accessible even if the IP address changes.
Common DDNS service providers include No-IP, DynDNS, and Cloudflare, among others. I mainly use DDNS for Wake On Lan and remote gaming streaming through Moonlight and Sunshine.
DDNS-GO is an open-source dynamic DNS solution that helps users access home network services via DDNS and achieve internal network penetration, among other things. DDNS-GO supports use on various operating systems, including Linux (various distributions, including fnOS), Windows, macOS, and routers using OpenWRT, including main routers and bypass gateway. DDNS-GO is compatible with multiple DNS service providers such as Cloudflare, AliDNS, GoDaddy, DNSPod, etc. It is very flexible and supports both IPv4 and IPv6 dynamic address acquisition and settings. It also provides a simple web management interface for easy configuration and monitoring of dynamic DNS services.
This article is not only applicable to the OpenWRT system but also to other systems like fnOS when using the DDNS-GO plugin.
📝 Main Content
Prerequisites for Configuration
The DDNS service provider used in this tutorial is Cloudflare, and you need to have your own domain name bound to Cloudflare.
Additionally, you need devices in your local network to be able to obtain public IPv6 addresses normally.
For the installation of the ddns-go service, I personally recommend installing it on the bypass gateway because our IPv6 RA (Router Advertisement) server is also this device. If installed on the main router, it may not be able to obtain a complete list of IPv6 neighbors. If the main router has enabled the RA server mode, installation on the main router is also possible.
Installing luci-app-ddns-go
Most repositories provide the luci-app-ddns-go plugin, which can be installed through System - Software Packages, or you can install it via SSH command like I did.
After successful installation, refresh the router management page, and you should see DDNS-GO under the Services tab. If it's not there, you can log out of the router management page and log back in.
Configuring the luci-app-ddns-go Plugin
The role of the luci-app-ddns-go plugin is to provide a visual luci interface for the configuration and management of the ddns-go core. It does not directly handle DDNS detection, updates, and domain name resolution services. Only after configuring the luci-app-ddns-go plugin and starting the service can you proceed with DDNS configuration.
The configuration is very simple:
- Check the box to start.
- If you need to customize the access port for ddns-go, you can change the settings port, but I will keep it unchanged here.
- Specify the DNS resolution server, you can choose Ali DNS or Tencent DNS. If your router itself has gone through a proxy, you can choose an international DNS or set it to your own custom DNS.
- For other items, if there are no special preferences, keep them unchanged.
- Save and apply.
Once you see that the DDNS-GO server has started, it means it's successful, and you can access it via
http://router IP address:9876
For the first login, you need to set up an administrator account and password; just follow the prompts to configure.Configuring DDNS Service
Visit Cloudflare's User API Tokens page: User API Tokens - Cloudflare
Or go through the top right account - Appearance - API Token to enter the User API Tokens page.
We need to create an API token for DDNS-GO to use for modifying the corresponding domain name's resolution address.
Click Create Token, select Edit Zone DNS, and click the Use Template button behind it.
In Zone Resources - Specific Zone - Select's dropdown, choose the domain name you have bound.
Then click Continue to display the summary - Create Token to see the API token (API Token) string, copy and save it in a safe place.
Configuring Router's DDNS Domain Name
If your router itself does not need to configure a DDNS domain name, you can skip this part.
Access the DDNS-GO web interface via
http://router IP address:9876
.DNS Provider:
Choose Cloudflare
Token fill in the API token (API Token) we just obtained
TTL does not need to be changed, it only takes effect after an IP change.
IPv4 section:
Domain (domain) fill in the domain name you want to use, for example, I wrote home.xxxx.xom
Others do not need to be changed.
IPv6 section:
Check the box to start
Get IP Method do not need to change
Domain (domain) fill in the same domain as ipv4.
Then scroll down to the bottom, click Save, and then click the Logs in the upper right corner to check the operation:
Seeing "
Added domain xxxxxx successfully
" means it's added successfully. Wait for a while for the DNS resolution broadcast to end, and then you can access it over the public network using this domain name:port
method.Configuring Local Network Client DDNS Domain Name
Again, it's important to note that if you are providing the local network's IPv6 RA service through a bypass gateway, then you need to install DDNS-GO on the bypass gateway, otherwise, you won't be able to obtain a complete list of IPv6 routes, nor can you bind DDNS domain names for clients.
Configuring the DDNS domain name for local network clients is essentially the same process as configuring the router's DDNS, using the Cloudflare API Token we obtained earlier.
Click Add in the upper right corner of the DDNS-GO management page.
DNS Provider:
Choose Cloudflare
Token fill in the API Token we obtained earlier
TTL choose Auto
IPv4 section:
Uncheck the start button. We have only one public IPv4 address, which has already been assigned to the router itself, so we won't configure IPv4 here.
IPv6 section:
Check to start
Get IP Address Method (Get IP Method) choose the last one By Command, which is the command mode
Enter the following command to extract the IPv6 address of a specific local network device. The MAC address should be lowercase, and if copied from Windows, replace - with :
By viewing the IPv6 neighbor list, filter out the IPv6 address that matches the MAC address and extract the address starting with 240 public network.
Then scroll down to the bottom, click Save, and then click the Logs in the upper right corner to check the operation.
Seeing "Added domain xxxxxx successfully" means it's added successfully. Wait for a while for the DNS resolution broadcast to end, and then you can access it over the public network using this
domain name:port
method.🤗 Summary
By configuring the DDNS domain names for local network clients, you can avoid remembering long and complicated IPv6 addresses and also avoid not being able to access the services deployed at home due to IPv6 address changes. After binding DDNS, remember to configure rules for the corresponding service ports in the firewall; otherwise, you still won't be able to access them.
Although this article uses Cloudflare as the DDNS service provider, the configuration for other service providers is similar and can be applied by analogy.
📎 参考文章
有关OpenWRT安装或者使用上的问题,欢迎您在底部评论区留言,一起交流~