Ubuntu Dynamic IP with NameCheap

Running a local Ubuntu server from an inexpensive ISP connection without a static IP is possible using a dynamic DNS client.  The dynamic DNS client will automatically update the Name Server records for your domain anytime it detects an IP change.  It is not as reliable as a static IP but it is good enough if you are on a budget.

IMPORTANT:  Before running the apt-get installer you must enter the initial dynamic IP records at NameCheap  (example below for chronos.xmonit.com)

  1. Login to NameCheap and navigate to Advanced DNS admin page (https://ap.www.namecheap.com/Domains/DomainControlPanel/{your namecheap domain}/advancedns)

  2. If you know the current DHCP IP from your router, go ahead and enter the correct IP in the Value column.  The ddclient will push the correct values after it is running.  Notice the Host column does not include the fully qualified host name and just the sub-domain.
    Example screen shot from NameCheap admin page

  3. Run the installer

    sudo apt install ddclient

    Enter some values like below to get the installer to complete then update /etc/ddclient.conf to correct the protocol and use properties afterwards.

    Dynamic DNS service provider Other
    Dynamic DNS server dynamicdns.park-your-domain.com
    Protocol dyndns2 (change to namecheap after installer exits)
    User name for Dynamic DNS Service {your namecheap domain}  Example: xmonit.com
    Password for dynamic DNS service

    Navigate to Advanced DNS settings and get the password from "Dynamic DNS Password"

    Network interface used for dynamic DNS service enp3s0 (Use ifconfig or similar tool to view network interface.  Usually eth0)
    DynDNS fully qualified domain names Example: chronos.xmonit.com,home.xmonit.com
  4. Manually edit /etc/ddclient.conf

    use=web, web=dynamicdns.park-your-domain.com/getip
  5. Check /var/log/syslog for errors.  Use 'sudo service ddclient force-reload' after new changes.  

    Note:  force-reload will not push changes if last change was less than 5 minutes ago.

    Jul  9 16:17:10 chronos ddclient[13602]: SUCCESS:  updating chronos.xmonit.com: good: IP address set to
    Jul  9 16:17:10 chronos ddclient[13602]: SUCCESS:  updating home.xmonit.com: good: IP address set to