Setup dynamic DNS using ddclient and configure for noip.com on CENTOS 7

yum install ddclient

There are some dependencies, however all of them should be installable from mainstream repos:

bash perl perl-Digest-SHA1 perl-Getopt-Long perl perl-IO-Socket-SSL shadow-utils systemd

Now that ddclient and it’s dependencies are installed it is time to edit it’s config file /etc/ddclient.conf:

[root@easy ~]# cat /etc/ddclient.conf
 ######################################################################
 ### (CC BY 3.0 IE) int21hex at https://laptopdoctor.wordpress.com/
 ### Based on https://www.andreagrandi.it/ blog post
 ### /etc/ddclient.conf
 ### Setup Environment

daemon=900                                     # go easy on the server
 syslog=yes
 #mail-failure=root # no place like /dev/null, leaving in for later
 pid=/var/run/ddclient/ddclient.pid
 ssl=yes

#######################################################################
 ### Workaround for ddclient to work with no-ip.com
 ### Grab external IP dyndns.com, use that for connection to noip.com
 ### Your $dynamicFQDN should be already setup

protocol=dyndns2
 use=web, web=checkip.dyndns.com/, web-skip='IP Address'
 server=dynupdate.no-ip.com
 login=$YourUsername
 password=$YourPasswd
 $dynamicFQDN
 mx=mail.$dynamicFQDN
 backupmx=no
 #wildcard=yes|no                                 # left for later

It’s not bad idea to update /etc/hosts with new domain name:

[root@easy ~]# cat /etc/hosts
 127.0.0.1 localhost.locadomain localhost
 127.0.0.1 customname.localdom customname
 192.168.xxx.xxx $dynamicFQDN

With that out of the way, it is time to set up and enable system service:

[root@easy ~]# systemctl enable ddclient.service
[root@easy ~]# systemctl start ddclient
[root@easy ~]# systemctl status ddclient
 ● ddclient.service - A Perl Client Used To Update Dynamic DNS Loaded:
 loaded (/usr/lib/systemd/system/ddclient.service; enabled; vendor
 preset: disabled)
 Active: active (running) since Sat 2017-07-01 21:47:42 IST; 2h 47min ago
 Main PID: 1629 (ddclient - slee)
 CGroup: /system.slice/ddclient.service
 └─1629 ddclient - sleeping for 300 seconds

Jul 01 21:47:40 vger systemd[1]: Starting A Perl Client Used To Update
Dynamic DNS...
Jul 01 21:47:42 vger systemd[1]: Started A Perl Client Used To Update
Dynamic DNS.

You can test if it’s working in couple ways. Noip.com dashboard will tell you if hostname is active

After ports are forwarded you can try accessing any of the services running on the server, like Webmin!

https://yourname.no-ip

Third option is to check DNS records for your $dynamicFQDN:

[root@easy ~]# nslookup $dynamicFQDN
 Server: 89.101.160.4
 Address: 89.101.160.4#53

Non-authoritative answer:
 Name: $dynamicFQDN
 Address: xxx.xxx.xxx.xxx

Enjoy!