This document outlines how to connect a custom domain using the Asuswrt-Merlin firmware.
During the use of Google Domains, it was sold to Squarespace. After transferring the domain from Google Domains to Cloudflare, the process of setting up custom DDNS is documented here.
REQUIREMENTS
To set up custom DDNS, the following items must be prepared:
- Firmware Version:
Since we will be using the inadyn package to set up custom DDNS, a version of 384.7 or higher is required. - JFFS:
JFFS must be enabled for the custom DDNS setup. - SSH:
You need permission to access the router.
This document does not provide explanations for the requirements.
CHANGE DDNS
We will change the existing DDNS settings.
In the DDNS settings, change the Server to Custom.
In the DDNS settings under the WAN category, change the Server option to Custom.
ISSUE API TOKEN
Obtain a token from Cloudflare's API Tokens page with the following permissions:
- zone.zone read
- zone.dns edit
After issuance, the result will be:
SETUP INADYN
MAKE CONFIG
Create the /jffs/inadyn.conf
file.
In this scenario, we will use two providers because we are using a wildcard domain.
# Domain
# If using a single provider, remove `:1`.
# provider cloudflare.com
provider cloudflare.com:1 {
username = "xiyo.dev"
password = API_TOKEN # Enter the issued token, enclosed in double quotes.
hostname = "xiyo.dev"
ttl = 1 # optional, value of 1 is 'automatic'.
proxied = false # optional.
}
# Wildcard Domain
provider cloudflare.com:2 {
username = "xiyo.dev"
password = API_TOKEN # Enter the issued token, enclosed in double quotes.
hostname = "*.xiyo.dev"
ttl = 1 # optional, value of 1 is 'automatic'.
proxied = false # optional.
}
CHECK CONFIG
Check the syntax of the configuration.
RUN INADYN
Run inadyn to register the IP with the domain.
AUTOMATION
Set it up so that the IP connected to the domain changes whenever the IP changes.
If the /jffs/scripts/ddns-start
file does not exist, create it and grant execution permissions.
touch /jffs/scripts/ddns-start
chmod +x /jffs/scripts/ddns-start
Enter the following content into the /jffs/scripts/ddns-start
file.
CHECK
Verify whether the domain is connected to the actual IP.
Run:
nslookup xiyo.dev
Result:
Server: XIYOsRouter
Address: 192.168.1.1
Non-authoritative answer:
Name: xiyo.dev
Address: 124.5.184.78
If the IP shown on the router matches, it has been set up correctly.
AFTER
Now, even if the router reboots or the IP changes, the domain will always point to the router.
In the next section, we will outline how to install a certificate on the router.