This is a quick-n-dirty set of instructions, mostly to remind myself how I set it up in my environment. Yours may, and probably will, differ.
- You've purchased a domain (let's call it 'selfhosted123.com' for the sake of argument) from Namecheap.
- You're using Namecheap BasicDNS, PremiumDNS, or FreeDNS: if you're using Namecheap to host a website, you're probably using Namecheap Web Hosting DNS, which doesn't support DDNS.
- Log into Namecheap, go to your Domain List, and select
Manage
. - Go to
Advanced DNS
. - Scroll down to the
Dynamic DNS
section. - Enable Dynamic DNS via the toggle to the right.
- Make note of the Dynamic DNS Password that appears. For this example, let's use 'werewrw8ewr5qfffDr5'.
- Log into Namecheap, go to your Domain List, and select
Manage
. - Go to
Advanced DNS
. - Scroll down to
Host Records
, selectAdd New Record
. - Choose
Type
ofA + Dynamic DNS Record
. - For
Host
, enter @ if you want to apply the dynamic IP to your root domain, * if you'd like a wildcard for all non-existent subdomains, or put in a subdomain like 'vpn' or 'api' or whatever you like. For this example, let's use 'vpn'. - Put in a dummy IP address for
Value
, as it'll be updated by the DDNS client. - Leave
TTL
at Automatic unless you have a reason to do otherwise.
TL;DR: Using your preferred tools, send an HTTPS request that looks like this:
Where host
equals the same thing you entered in the DDNS host record, domain_name
equals your root domain, ddns_password
equals the one supplied by Namecheap in their DDNS configuration, and your_ip
equals the one you wish to assign to that host.
Using our example data, that request would look like: https://dynamicdns.park-your-domain.com/update?host=vpn&selfhosted123.com&password=werewrw8ewr5qfffDr5&ip=127.0.0.1 (Please think carefully about using loopback as your public IP address, though...)
For more information, check out the Namecheap docs.
I use a UniFi controller for my network, so the details will vary based on your infrastructure.
- In the Controller, go to the
Internet
section ofSettings
, then select your WAN. - Scroll down to the
Dynamic DNS
section, selectCreate New Dynamic DNS
. - Enter the correct values:
Service
: select "namecheap".Hostname
: enter the same thing as you entered in the DDNS host record, e.g. '@' or '*' or your subdomain. In this case, 'vpn'.Username
: enter your root domain. In this case, 'selfhosted123.com'.Password
: enter the value from Namecheap. In this case, 'werewrw8ewr5qfffDr5'.Server
: enter 'dynamicdns.park-your-domain.com' to use Namecheap's DDNS server.
- Save, and you're done.
- Namecheap Dynamic DDNS Client Software
- ddclient
- ddns-updater
- Check your router's manual
Check the public IP listed for your WAN in your gateway, or use a tool like http://checkip.dyndns.org/, and then try resolving your DDNS-enabled hostname to verify that they match.