Installing and Configuring the No-IP Dynamic DNS Client on CentOS 7

Installing and Configuring the No-IP Dynamic DNS Client on CentOS 7 [Операционные системы]

Автор статьи : Almas O.
Организация : Institute of Intelligent Technoligy
Должность : professor
Дата : 08.01.2017
Номер журнала : 02-08-2017

Аннотация қазақ тілінде
Бұл мақалада CentOS 7.3.1611 операциялық жүйесінде No-IP Dynamic Update Client (DUC) қызметін орнату және баптау процесі сипатталады. Мақаланың мақсаты – жергілікті желіде динамикалық IP мекенжайы бар серверлер үшін тұрақты домен атауын қамтамасыз ететін шешімді іске асырудың нақты қадамдарын ұсыну. Зерттеу әдісі ретінде тәжірибелік нәтижелерді талдау және ресми құжаттаманы қолдану қолданылды. Мақалада No-IP тіркелгісін жасаудан бастап, клиенттің орнатылуы, бапталуы және жүйенің қайта жүктелуі кезінде автоматты түрде іске қосылуын қамтамасыз ету сияқты барлық кезеңдер қарастырылады. Нәтиже ретінде оқырман динамикалық DNS қызметін пайдаланып, серверіне сыртқы желіден тұрақты домен атауы арқылы қатынай алатын толық жұмыс істейтін конфигурацияға ие болады. Қорытындыда мұндай конфигурацияның маңыздылығы және оны сақтау бойынша ұсыныстар келтіріледі.

Аннотация на русском языке
В данной статье описан процесс установки и настройки клиента динамического обновления No-IP (Dynamic Update Client, DUC) в операционной системе CentOS 7.3.1611. Цель статьи – представить четкие шаги по реализации решения, обеспечивающего постоянное доменное имя для серверов в локальной сети, имеющих динамический IP-адрес. В качестве метода исследования использован анализ практических результатов и применение официальной документации. В статье рассматриваются все этапы: от создания учетной записи No-IP до установки клиента, его настройки и обеспечения автоматического запуска при перезагрузке системы. В результате читатель получит полностью рабочую конфигурацию, позволяющую обращаться к своему серверу из внешней сети через постоянное доменное имя, используя динамический DNS-сервис. В заключении подчеркивается важность такой конфигурации и даются рекомендации по ее поддержанию.

Abstract in English
This article describes the process of installing and configuring the No-IP Dynamic Update Client (DUC) on the CentOS 7.3.1611 operating system. The article's aim is to provide clear steps for implementing a solution that ensures a permanent domain name for servers on a local network with a dynamic IP address. The research method involved analyzing practical results and utilizing official documentation. The article covers all stages: from creating a No-IP account to installing the client, configuring it, and ensuring it starts automatically upon system reboot. As a result, the reader will obtain a fully functional configuration that allows access to their server from an external network via a permanent domain name using a dynamic DNS service. The conclusion emphasizes the importance of such a configuration and provides recommendations for its maintenance.

Introduction

In the context of expanding remote work and the need to access local resources (such as web servers, file storage, or surveillance systems) from the public internet, the problem of dynamic IP addresses provided by most Internet Service Providers (ISPs) becomes particularly relevant. A dynamic IP address can change periodically, making it impossible to use a static address for stable remote access. One of the most common and reliable solutions to this problem is the use of a Dynamic Domain Name System (Dynamic DNS or DDNS) service. Such services automatically associate a changing IP address with a permanent domain name. No-IP is one of the leading providers of free and commercial DDNS services. To ensure the functionality of the service, a special client software—the Dynamic Update Client (DUC)—must be installed on the machine within the local network. This client periodically informs the No-IP server about the current public IP address of the network. The practical significance of this article lies in providing system administrators and advanced users with a verified, step-by-step guide for deploying the No-IP DUC client on a server running CentOS 7, a popular and stable distribution in the enterprise environment. The relevance of the topic is underscored by the growing number of self-hosted services and the need for their reliable accessibility [1, p. 45].

Main Part

1. Prerequisites and Preliminary Steps

Before starting the installation, several preparatory steps must be completed. First, you need to register an account on the official No-IP website (https://www.noip.com) and create at least one hostname (e.g., yourhost.ddns.net). This hostname will be the permanent address for accessing your server. Secondly, you need to ensure that the server has a stable connection to the internet and that the necessary ports for outgoing connections are open. The machine must also have a standard set of development tools for compiling the client from source code. The client installation and configuration will be performed with superuser (root) privileges. If you are working under a regular user account, you can use the sudo command for all operations requiring elevated rights.

2. Installing Necessary Development Tools

The No-IP DUC client is distributed as source code and requires compilation on the target system. Therefore, you must first install the development tools and compiler. In CentOS/RHEL-based systems, this is done using the yum package manager (in CentOS 8 and later, dnf is used).

Execute the following command to install the required packages:

yum groupinstall "Development Tools" -y
yum install wget -y

The first command installs a comprehensive set of tools, including the GCC compiler and the make utility. The second command installs wget, which is needed to download the client archive from the internet.

3. Downloading and Compiling the No-IP DUC Client

The next step is to download the source code of the client from the official No-IP website. It is recommended to perform all operations in the directory intended for locally compiled software, such as /usr/local/src.

cd /usr/local/src/
wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz

After downloading, you need to extract the archive and navigate to the created directory. The version number in the directory name may differ from the one in the example.

tar xzf noip-duc-linux.tar.gz
cd noip-2.1.9-1/

Now you can proceed to compile the client. To do this, simply run the make command in the current directory. This command will compile the executable file noip2 based on the provided source code and Makefile.

make

If the compilation completes without errors, you can proceed to install the client into the system. Installation is performed using the command:

make install

During the installation process, the installer will ask several configuration questions interactively. You will need to enter the login (email) and password for your No-IP account, select the hostname to update from the list of those available in your account, and set the update interval (the recommended value is 30 minutes, although for testing you can set it to 5 or 10). Additionally, you will be asked whether to run a script upon successful update; for most cases, you should answer 'N' (No). Proper configuration at this stage is crucial for the client's correct operation [2, p. 102].

4. Client Management and Autostart Configuration

After a successful installation, the noip2 client will be located in the /usr/local/bin/ directory. To start the client immediately, run:

/usr/local/bin/noip2

You can check the client's operation status with the command:

/usr/local/bin/noip2 -S

This command will display information about the running process and the hostnames being updated.

For the service to automatically start after a system reboot, it must be added to autostart mechanisms. In CentOS 7, the preferred method is to create a systemd service unit, as the traditional /etc/rc.local file may not be active by default. However, for simplicity and compatibility with the instructions from the original article, the method using rc.local is described. First, ensure that the /etc/rc.d/rc.local file has execute permissions:

chmod +x /etc/rc.d/rc.local

Then, add the command to start the client to this file using a text editor (e.g., vi or nano):

echo "/usr/local/bin/noip2" >> /etc/rc.d/rc.local

A more modern and correct approach is to create a dedicated systemd service file (e.g., /etc/systemd/system/noip2.service) with the following content [3]:

[Unit]
Description=No-IP Dynamic DNS Update Client
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/bin/noip2

[Install]
WantedBy=multi-user.target

After creating the file, you need to enable the service for autostart:

systemctl daemon-reload
systemctl enable noip2.service
systemctl start noip2.service

5. Verification and Troubleshooting

To verify that the service is functioning correctly, you should check its status a few minutes after launch:

systemctl status noip2.service
/usr/local/bin/noip2 -S

You can also check the update logs. The client writes diagnostic information to the system log (/var/log/messages or /var/log/syslog). Use the tail -f /var/log/messages command to monitor the logs in real-time. Common issues include incorrect account credentials, firewall blocking outgoing connections on port 80 (HTTP) or 443 (HTTPS) used by the client for updates, and network configuration problems (e.g., the server not having a route to the external network). In case of errors, carefully review the configuration steps and check the network settings.

Conclusion

Installing and configuring the No-IP Dynamic Update Client on CentOS 7 is a straightforward process that significantly enhances the accessibility of local network resources. By following the steps outlined—installing development tools, downloading and compiling the client, performing initial configuration, and setting up autostart—a system administrator can ensure a stable connection between a dynamic public IP address and a permanent domain name. Using a systemd service for autostart is the recommended method in modern CentOS/RHEL distributions, as it provides better integration with the system's service management. After completing the setup, it is important to regularly monitor the service's operation and update the client when new versions are released by the developer to maintain security and stability. The implementation of such a solution is a fundamental element of the infrastructure for small offices, home labs, and developers requiring remote access to their environments.

References

  1. Tanenbaum, A. S., & Wetherall, D. J. Computer Networks. 5th Edition. – Pearson, 2010. – 960 p.
  2. No-IP.com. Dynamic DNS Update Client (DUC) for Linux – Official Documentation [Online resource]. – 2022. – URL: https://www.noip.com/support/knowledgebase/installing-the-linux-dynamic-update-client/ (accessed: 15.03.2024).
  3. Red Hat, Inc. systemd.service — Systemd service unit configuration [Online resource]. – Red Hat Customer Portal. – URL: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-unit_files (accessed: 15.03.2024).
  4. Nemeth, E., Snyder, G., Hein, T. R., Whaley, B., & Mackin, D. UNIX and Linux System Administration Handbook. 5th Edition. – Addison-Wesley Professional, 2017. – 1176 p.
  5. Journal article submission requirements [Online resource] – https://adisteme.kz/trebovaniia-k-oformleniiu-stati.html