Author of the article
Vitaly Leonidovich Cherkasov
System administrator, computer systems engineer.
Ask a Question
Many modern routers can support the DDNS protocol. Not everyone knows why it is needed and how to use it. In short, DDNS is Dynamic DNS, a way to update domain name information on a server.
Definition
DDNS (or dynamic DNS) service allows you to access a network device over the Internet, even if it has a dynamic IP address. I’ll tell you using the example of a home router, which almost every home has.
Imagine that we have a regular home Wi-Fi router that is connected to the Internet. When connecting to the Internet, the provider issues it an external IP address. Similarly, there is also an internal or local address, but we won’t need it here.
The fact is that IPv4 technology is now used, which has a small range of addresses from 0.0.0.0 to 255.255.255.255. At the same time, a huge number of addresses have already been reserved. Since there are more and more subscribers every day, and fewer and fewer free addresses, providers have long stopped issuing so-called static IPs.
This IP does not change over time and remains constant. For the provider, such addresses cost additional money, and usually a mere “mortal” is given a dynamic address that is constantly changing.
Now let's imagine that you need to access your router from the Internet. To do this, you can log into the router using its external IP address. To find out your numbers, just enter the request in Yandex: “My IP”.
If you open external access on your router (I’ll talk about this below) and enter this address into the address bar of your browser, you will be taken to the router settings. The problem is that when the IP changes, you will lose access. Very often this function is used when forwarding ports.
For example, you installed CCTV cameras in your apartment or house and want to monitor your home from work or when you are relaxing on vacation. Everything is the same - access will be open for some time, but when the external IP is changed, the “shop will close.”
That is why a DDNS service was invented for such purposes. You will be able to use not an IP address, but a special DNS Dynamic, which will be permanent. And even if the external address changes, you will still be able to have access to your router, and therefore to all local network devices in the house.
This way you can configure:
- Gaming service.
- FTP server.
- Access to your workplace.
- CCTV cameras and DVR.
It seems that everything is so simple, but in fact there is one more nuance, which I will talk about in the next chapter.
Debugging your configuration
Internaly, DD-WRT uses inadyn and creates in the directory /tmp/ddns a configuration file from your settings in the web form. To check whether the expected configuration file is created from your settings in the web form, you can inspect this file as follows:
- ssh or telnet to the router
- navigate to /tmp/ddns: cd /tmp/ddns
- inspect file inadyn.conf: cat /tmp/ddns/inadyn.conf
- the inadyn cache file in DD-WRT is located /tmp/ddns/inadyn_ip.cache
If you are not familiar with the format of the inadyn.conf file, you can just call /usr/sbin/inadyn from the command line and the allowed parameters are shown.
Put "--verbose 5" in the additional ddns options to get some helpful information.
Gray and white IP - what's the difference
In the Internet industry and networks there are two concepts: gray and white IP addresses. White IP - issued by the provider, and it is also public. That is, there are no intermediary local networks between your router and the Internet. Roughly speaking, your router is directly connected to the Internet via the WAN port. In this case, you can organize access from the Internet to devices on your local network. A white address can be either dynamic or static.
But some providers issue not white, but gray addresses. That is, the router will eventually be first connected to the provider’s local network, in which it is given a local address, and only then through some gateway it will be connected to the Internet. As a result, traffic does not go directly through the router and WAN port, but also through an additional local network.
And here we encounter the problem that DDNS cannot be configured for a gray IP address in some routers. But there is no need to worry, and there are some devices that can still install remote access with built-in applications.
Which DNS server should I enter?
The “TCP/IP Protocol Properties” window will open, in which you need to check the box Use the following DNS server addresses. We register the “Preferred server” as 8.8.8.8, and the “Alternative server” as 8.8.4.4. Click OK.
Interesting materials:
Amediateka how to cancel a subscription? Whose horoscope stone is amethyst? How to conduct market analysis? Android process acore stopped how to fix? Angara where does the river flow? Anthurium flower how to care for it? How are Arabic numbers read? Avocado what's its name? How to plant marigolds? How long do marigolds bloom?
How to check white IP address?
First you need to go to the router settings. To do this, when connecting to the local network from any device: computer, laptop, phone, tablet or even TV, you need to open a browser and enter the router address in the address bar. The address can be seen on the label under the case. Very commonly used IP addresses are 192.168.1.1 or 192.168.0.1.
NOTE! If you have problems with this, then look at these instructions.
Next you need to look at what external IP address your router accepts.
TP-Link
Old firmware: on the main page or in the “Status” section we find “WAN” - “IP address”.
New firmware: “Basic setup” tab, “Network diagram” - look for the “Internet” section.
D-Link
On the main page we look for WAN IP.
ASUS
Click on “Primary WAN” and on the right you will see a line “WAN IP Address”.
Zyxel Keenetic
Old firmware: on the main tab “System” - look at the line “IPv4 Address”.
New firmware: on the main page, open “More details about the connection” in the “Internet” section.
Next, look at the “IP address” section.
Other models
Typically, information about external IP is located immediately on the main page in the “WAN” or “Internet” line. The line may also be called “WAN IP” or “External IP”.
After you have found the external address in the router, you need to go to the browser and find out what IP is displayed there - you already know how to do this. If the addresses are the same, then you have a “White IP”; if they are different, then you have a “Gray” IP.
Setting up on different brands of routers
After you have made sure that your provider provides a “white” IP address and have selected a DDNS service, you can begin setting up your router. Different routers configure DDNS differently. Let's look at how to configure the most common router models.
TP Link
To configure DDNS on your TP-Link router, you need to select “Dynamic DNS” in the left menu. After that, select one of three DDNS service providers: Dyndns, NO-IP or Comexe.
Enter the domain name you received when you registered with the selected provider. To connect, you also need to enter the username and password for your account with your DDNS provider. Before finishing the setup, check the “Enable DDNS” box and click on the “Login” button. When the connection status changes to “connected”, you can click on the “Save” button.
D Link
To start setting up DDNS on a D-Link router, you need to select “Advanced” in the left menu and click on the “DDNS” line. You can use any available services for this router. You can also use a proprietary service from D-Link called DlinkDdns.
Asus
To configure DDNS on an Asus router, you need to select “Internet” in the left menu, and then “DDNS” in the top menu. Next, select the supplier’s server, enter the host name and click “Apply”.
Keenetic
The Keenetic router has a KeenDNS function, thanks to which you can configure access to the router, even if the provider issues gray IP addresses. However, in this case, the cloud will be used to transfer data.
To take advantage of KeenDNS capabilities you need:
- select “Domain name”;
- enter a custom router name;
- Choose one of the three proposed domain names;
- enable the Keenetic Cloud service;
- select the connection operating mode, if the IP is “white” select “Direct access”, if gray “Via the cloud”;
For Zyxel Keenetic routers, you need to go to the “DDNS” tab and select the service to use. Then enter the service address, domain name, username and password. Then click the “Apply” button.
How DDNS works
- You register for a special service. Everything goes the same way as on any other site: enter your login, password, mailbox and other registration data.
- When you activate your account, you will receive an email to do this.
- Log in to your personal account and create your DDNS.
- Enter the required data in the router settings.
NOTE! To set up domain access to a computer when connected to the Internet, special programs are used directly, which can be downloaded from the same sites.
- After this, you can access your router using this DDNS.
Getting a domain name
To set up a dynamic domain name system, you need to obtain a domain name. You can buy it or find a service that will give you the name for free with some restrictions (up to 3 hosts). An example of such a service is noip.
Goal: you need to register with noip and get a domain name for free.
Open the website noip.com.
Click on “Language” and change the language to Russian. Go to the main page. We write the domain name and select the zone, then click on the sign button. Next, fill in the necessary fields to create an account:
- Email;
- password;
- domain name.
IMPORTANT! After registering with noip, you must confirm your email address.
How to set up DDNS
DDNS is configured in the router settings. Therefore, first of all, you need to go to it. Next, you need to find the DDNS or “Dynamic DNS” section. You need to look at what services are used specifically in your router. Some devices can use a limited number of services (such as TP-Link). But there are routers that work with any DDNS services. In general, the scheme will be quite simple, consisting of three steps:
- We go into the router settings and look at what services the device works with.
- We select a service from those presented - go to the official website and register.
- Again in the same window, enter the dynamic DNS data.
[edit] Give UP?
I gave up on trying to setup my freedns.afraid.org setup and just set a cron script at startup to use freedns' wget method of updating my dns every 5 minutes on the router. If this does not work for you, some variation on this theme might:
NOTE: In the above, the XXXXXX is an id number provided by freedns.afraid.org
Note2: This shouldn't be necessary and causes more traffic than is needed. Please read my entry in the afraid.org section above. It does work.
Note3: FYI the busybox wget command on your version of dd-wrt may not work with https, so you may have to use the unsecure http protocol to update DNS via URL.
Safety
You must understand that by opening your router to the Internet, you are taking a security risk. Therefore, first of all, go to the router settings and set a strong password for the Web interface. I would also advise changing the login for the administrator. The most commonly used login is “Admin”, and this is a big hole for brute force hacking.
NOTE! By the way, on some routers you cannot change the administrator login.
If you open a VPN server or FTP, then you also need to set reliable authorization data there. The same applies to the DVR or individual video surveillance cameras. In each of these devices you need to set a login and password. You can disable domain access at any time by going to the same settings.
Prerequisites
Requirements
Readers of this document should have knowledge of the following topics:
- Cisco IOS Command Line Interface (CLI)
- General DNS Behavior Model
Components used
The information contained in this document is based on the following software and hardware versions:
- Cisco 2500 Series Routers
- Cisco IOS Software 12.2(24a)
The information presented in this document was obtained from devices operating in a specific laboratory environment. All devices described in this document were launched with a clean (standard) configuration. On a production network, the potential impact of all commands should be examined before using them.
DuckDNS
Dynamic DNS provider DuckDNS is built using Amazon infrastructure. The website is simple and the entire system is managed by just two software engineers.
There are many instructions written for this service that will help you set up DuckDNS on a number of platforms. These platforms include, but are not limited to, macOS, Windows and Linux.
There are currently four subdomains allowed on duckdns.org. You will only get more if you donate to the team.
DnsDynamic
DnsDynamic offers a wide selection of domains, including .com. This service will also allow you to register an unlimited number of hosts.
On Windows or Linux clients, IP addresses will be updated to the DNS name through a free VPN service.
The downside to this free service is that it is difficult to set up. You will have to pay close attention to data protection guidelines.
FreeDNS
FreeDNS offers one of the easiest ways to quickly set up dynamic DNS. (And also offers static DNS services).
There are tens of thousands of domains to choose from, as well as the ability to use your own domain names. It is currently one of the most popular dynamic DNS providers, processing over 7 billion queries per month.
The process of creating an account is quite simple and will take no more than five minutes. After setting up an account, the DNS address is instantly set. You can also choose from over 90,000 domains. All of these domains offer URL redirection.