Record the process of using the DDNS dynamic domain name resolution service to access the intranet server service through the domain name from the external network once

DDNS concept

DDNS (Dynamic Domain Name Server) is an abbreviation for Dynamic Domain Name Service.
 DDNS maps the user's dynamic IP address to a fixed domain name resolution service. Each time the user connects to the network, the client program will transmit the dynamic IP address of the host to the server program on the host of the service provider through information transmission. , The server program is responsible for providing DNS services and realizing dynamic domain name resolution.

Service principle

DDNS captures the IP address that the user changes each time, and then corresponds it with the domain name, so that other Internet users can communicate through the domain name. And all that the end customer has to remember is to remember the domain name given by the dynamic domain name provider, regardless of how they achieve it.

The object of dynamic domain name service means that the IP is dynamic and changes. Ordinary DNS is based on static IP, which may be one-to-many or many-to-many, and the IP is fixed one or more. But the IP of DDNS is variable and random. With the changes in market demand, DDNS needs more and more functions, and more and more convenience is required. The market now has equipment that does not require third-party DDNS support.

Simply put, the IP address assigned by the DHCP server can be dynamically updated to the DNS service, eliminating the trouble of manual assignment.

Principle of DDNS: DNS + DHCP = DDNS

DHCP is responsible for ip parsing and assigning to client ip, ip is a random number.

DNS is responsible for domain name resolution, and the domain name corresponding to each ip is recorded in the A record.

Service role

1. At present, most ISPs provide dynamic IP (such as dial-up Internet access). If we want to publish in our own domain on the Internet, DDNS provides a solution. It can automatically update the floating IP that the user changes every time, and then combine it with Corresponding to the domain, so that other Internet users can communicate through the domain.

2. DDNS allows us to set up servers such as WEB\MAIL\FTP in our own or at home without having to spend money to pay the rent of the virtual host. (The premise is that you can withstand the rate of ADSL upload)

3. The host is your own, the space can be expanded according to your needs, and maintenance is more convenient. With a domain and space to set up a website, FTP server and EMAIL server are not a problem.

4. If you have a need for VPN, with DDNS, you can easily establish a tunnel with ordinary Internet access. Through the network domain connection, remote management, remote access, remote printing and other functions are realized.

Service application

At present, most ISPs provide us with dynamic IP (such as ADSL dial-up Internet access), and many network video servers and network cameras need a fixed IP for remote access, and the cost of a fixed IP is difficult for customers to accept. Therefore, DDNS proposes a brand-new solution for everyone. It can capture the user's IP that changes every time, and then correspond it with the domain name, so that customers can remotely monitor through the domain name.

Because of the different products and strengths of various companies, DDNS solutions are also different.

Router plug-in

Specifically, the router plug-in is a router with integrated DDNS. By applying for its domain name and service, fill in the user name and password obtained from the application into the relevant items of the router DDNS module, and then make port mapping on the router to point to the monitoring device that needs to be accessed. The remote monitoring terminal can access the current router by accessing the domain name, and judge and point to the monitoring equipment that needs to be accessed according to different ports.

At present, some dynamic domain name providers have begun to bundle their own hardware and DDNS for sale. This ensures the stability of the domain name without any subsequent costs, and provides users with a permanent stable and free DDNS. This kind of equipment does not require Apply for and bind a dynamic domain name, because every device has a built-in dynamic domain name when it leaves the factory, and you only need to do port mapping to access it.

Monitoring equipment integrated with DDNS

For unattended or inconvenient external router conditions, video surveillance can also use integrated DDNS network cameras, also fill in the user name and password obtained by applying for DDNS service in the relevant items, and directly connect through a broadband line such as ADSL. The remote monitoring terminal is directly accessed through the domain name.

Run DDNS client software

Run the DDNS client on any PC or server inside the LAN. At this time, the IP address resolved by the domain name is the public IP address at the exit of the LAN gateway, and then port mapping at the gateway to the monitoring device.

main effect:

1. Most broadband operators only provide dynamic IP addresses. DDNS can capture the IP addresses that users change each time, and then match them with domain names, so that other Internet users can communicate with users through domain names.

2. DDNS can help you build a virtual host in your own company or home.

Actual combat record

服务器端

[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

[root@localhost ~]# ifconfig | head -2
em1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.241  netmask 255.255.255.0  broadcast 192.168.2.255

[root@localhost ~]# ss -antulp | grep :29003
tcp    LISTEN     0      128       *:29003                 *:*                   users:(("beam.smp",pid=4223,fd=28))

[root@localhost ~]# ps -aux | grep beam.smp
ocean     4223  1.9  0.9 1208044 78356 pts/1   Ssl+ 7月06 288:47 /usr/local/lib/erlang/erts-6.4/bin/beam.smp -K true -c -- -root /usr/local/lib/erlang -progname erl -- -home /home/ocean -- true -pa /soft/ocean/ocean/ebin /soft/ocean/ocean/deps/amqp_client/ebin /soft/ocean/ocean/deps/cowboy/ebin /soft/ocean/ocean/deps/epgsql/ebin /soft/ocean/ocean/deps/erlydtl/ebin /soft/ocean/ocean/deps/gen_bunny/ebin /soft/ocean/ocean/deps/gen_smtp/ebin /soft/ocean/ocean/deps/gettext/ebin /soft/ocean/ocean/deps/iconv/ebin /soft/ocean/ocean/deps/jiffy/ebin /soft/ocean/ocean/deps/log4erl/ebin /soft/ocean/ocean/deps/meck/ebin /soft/ocean/ocean/deps/mochiweb/ebin /soft/ocean/ocean/deps/pgpool/ebin /soft/ocean/ocean/deps/poolboy/ebin /soft/ocean/ocean/deps/rabbit_common/ebin /soft/ocean/ocean/deps/rrdtool/ebin /soft/ocean/ocean/deps/strftimerl/ebin /soft/ocean/ocean/mod/mod_alarm/ebin /soft/ocean/ocean/mod/mod_assist/ebin /soft/ocean/ocean/mod/mod_base_data/ebin /soft/ocean/ocean/mod/mod_call_records/ebin /soft/ocean/ocean/mod/mod_cds/ebin /soft/ocean/ocean/mod/mod_common/ebin /soft/ocean/ocean/mod/mod_conference/ebin /soft/ocean/ocean/mod/mod_db/ebin /soft/ocean/ocean/mod/mod_files/ebin /soft/ocean/ocean/mod/mod_fsevent_http/ebin /soft/ocean/ocean/mod/mod_ippbx/ebin /soft/ocean/ocean/mod/mod_ivr/ebin /soft/ocean/ocean/mod/mod_log/ebin /soft/ocean/ocean/mod/mod_menu/ebin /soft/ocean/ocean/mod/mod_ola/ebin /soft/ocean/ocean/mod/mod_product/ebin /soft/ocean/ocean/mod/mod_recording/ebin /soft/ocean/ocean/mod/mod_routing/ebin /soft/ocean/ocean/mod/mod_skel/ebin /soft/ocean/ocean/mod/mod_switch_config/ebin /soft/ocean/ocean/mod/mod_ticket/ebin /soft/ocean/ocean/mod/mod_wechat/ebin /soft/ocean/ocean/mod/mod_xcds/ebin -boot start_sasl -s reloader -s ocean -s -sname ocean@localhost -setcookie ClueCon -config ocean
rabbitmq  4657  1.0  0.9 2328468 78008 ?       Sl   7月06 155:51 /usr/local/lib/erlang/erts-6.4/bin/beam.smp -W w -A 64 -P 1048576 -K true -B i -- -root /usr/local/lib/erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.1/ebin -noshell -noinput -s rabbit boot -sname rabbit@localhost -boot start_sasl -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,"/var/log/rabbitmq/[email protected]"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/[email protected]"} -rabbit enabled_plugins_file "/etc/rabbitmq/enabled_plugins" -rabbit plugins_dir "/usr/lib/rabbitmq/lib/rabbitmq_server-3.6.1/plugins" -rabbit plugins_expand_dir "/var/lib/rabbitmq/mnesia/rabbit@localhost-plugins-expand" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/var/lib/rabbitmq/mnesia/rabbit@localhost" -kernel inet_dist_listen_min 25672 -kernel inet_dist_listen_max 25672

路由器端

1. Log in to the TP-LINK enterprise router
Insert picture description here
2. Enter "System Services" and click on the "Dynamic DNS" function
Insert picture description here

It can be seen that the TP-Link enterprise-level router supports a variety of dynamic domain name resolution, and we use TP-LINK dynamic domain name by default.

3. Register TP-LINK ID to log in
Insert picture description here
4. Use the newly registered TP-LINK ID to log in to the TP-LINK dynamic domain name service
Insert picture description here
5. Add a dynamic domain name according to the TP-LINK dynamic domain name requirements and bind the WAN network interface
Insert picture description here
6. Use TP- The DDNS dynamic domain name in the LINK router can access the service on the intranet server.
Insert picture description here
 You can see that I can directly use the DDNS dynamic domain name just set up and the port 29003 of the intranet server service to directly access the service on our intranet server.

to sum up:

After we set the DDNS dynamic domain name on the router, no matter how the external IP on the operator's gateway changes dynamically, customers can directly use the domain name set in the router above to access the corresponding internal services of the company.

Guess you like

Origin blog.csdn.net/qq_40907977/article/details/114696914