DDNS is DNS service for dynamic IP

Dynamic DNS is a DNS service providing an actualization mechanism for frequently updating IP. Consist of 3 systems:
- DNS server that responds to requests for resolving domain names
- DDNS service providing an interface for update requests
- A client that monitors the host IP for changes and sends requests to the server when it changes

Why IP changes and you have to use DDNS

On the Internet, static IPs are most often used, but sometimes they are dynamic, as is common in local area networks (corporate and home). This happens on several cases:

  • When IP are assiged by DHCP server. In this case, the server specifies the lease time (TTL) of the address, for which this IP is assigned to the client. This is usually 2 weeks, but providers can change it by greatly lowering the period in order to increase the efficiency of using their pool of addresses.
  • When NAT is used and multiple addresses are specified on the router for translation. This behavior is typical for corporate networks. In home networks with a Wi-Fi router, NAT is always used, and threre is one white IP usually, and the IP change in this case is determined by DHCP.

DDNS standard protocol

The DNS address update protocol is standard and is described in RFC 2136. The DDNS update mechanism has not been described by the IETF, but is also de facto standardized. DynDNS (now known as DYN.COM, owned by Oracle) was the first DDNS service provider, so this protocol is called DynDNS2 and has the following format.

wget -O - http://{username}:{password}@dynupdate.alviy.com/nic/update?hostname={yourhostname}&myip={ipaddress}
where username and password this is the username and password in the DDNS system respectively, yourhostname hostname whose address is being updated and IP ipaddress.

It is worth noting that the DynDNS2 format is no longer supported by most browsers, as it is considered insecure due to passing credentials in clear text. As a result, a request comes to the server without username and password, which leads to authorization errors noauth. So it's better to use console utilities.

White and gray IP addresses in DDNS

You can often hear the terms "white" IP or "gray". Let's find out what is it and does dynamic DNS work with them. Internet access is provided by providers, they give IP addresses to users, which allows you to connect to the global web. As you know, IPv4 addresses are over. In order for an ISP to receive new IPs from IANA (the international organization that manages the distribution of subnets), they must make a request and get in multi-month line to receive released by somebody IP addresses. Moreover, each IP maintenance costs money and providers annually pay rent to IANA. In this regard, is often a situation when the provider has fewer available addresses than the clients, which leads to the need to dynamically manage them via DHCP, or use NAT.

When such an IP is assigned to a client, they say that he is "white", i.e. unique on the Internet and registered with IANA. In this case, there are no restrictions on networking.

When is NAT used, i.e. under one white IP access is organized for several clients, then they say that the IP is "gray". This means that the user has a local (private) address that works only in this local network:

  • — (
  • — (
  • — (
  • — (
Already on the provider's side, the router organizes a routing table, allowing you to broadcast the traffic of such clients to "white" addresses, this mechanism is completely hidden from the user, and there is no way to interfere with it. When using "gray" addressing, websites browsing is not limited in any way, but services that require incoming connections cannot function.

When they talk about a home router and its white IP, then the same NAT process takes place on it, but the user can drop ports and control the IP translation process in every possible way.