Own Dynamic DNS. How to make your own dynamic DNS server Static DNS servers into dynamic ones

YЪ-ЪB ITPOYUEULPK NPЪZPCHPK OEDPUFBFPYUOPUFY LFPZP RTPCHBKDETB, S UFBM YULBFSH UEVE OPCHSHCHK LBOBM CH yOFETOEF. yN UFBM chchzh gfl. lBBBMPUSH VSH, OILBLYI UMPTSOPUFEK U RPDLMAYUEOYEN RP ADSL OE CHP'OILMP, OP... opp gfl YURPMSH'HEF (LBL Y PUEOSH NOPZYE RTPCHBKDETSCH) BCHFPTYBGYA RP RTPFPPLPMH PPPoE, DBCHBS DYOBNYUEULYK IP-BDTEU, LPFPTSCHK NEOSEFUS LBTSDSCHK WEBOU UCHSY. rPLB NBYOB TBVPFBEF CH LBYEUFCHE LMYEOFB, LFP OE CHSHCHCHBEF PUPVSCHI RTPVMEN, OP LPZDB NOE RPOBDPVYMPUSH ЪBRKHUFYFSH ABOUT UCHPEN LPNRSHAFETE UETCHET, CHUFBMB RTPVMENB: LBL PVTBEBFSHUS YY CHOEYOEK UEFI L NBIYOE, BDTEU LPFPTPK RPUFPSOOP NEOSEFUS?

rPOSFOP, YuFP OEPVIPDYNP LBL-FP KHUFBOPCHYFSH UPPFCHEFUFCHYE NETSDH OELINE DPNOOOSCHN YNEOEN Y IP-BDTEUPN, RTYUEN UPPFCHEFUFCHYE LFP OBDP DYOBNYUUEULY NEOSFSH, YUFPVSH POP TEBMSHOP T BVPFBMP. rPYULBCH CH UEFY, WITH DPUFBFPYUOP VSHUFTP OBUY OYULPMSHLP UETCHYUPCH DYOBNYUUEULPZP DNS (DDNS, Dynamic DNS).

lBL LFP TBVPFBEF?

dYOBNYUUEULYK DNS LFP FEIOPMPZYS, RPЪCHPMSAEBS YOZHPTNBGYY ABOUT DNS ACCOUNTING PVOPCHMSFSHUS CH TEBMSHOPN CHTENEOY Y (RP TSEMBOYA) CH BCHFPNBFYUEULPN TETSYNE. POB RTYNEOSEFUS DMS OBYUEOYS RPUFPSOOPZP DPNEOOPZP YNEOY LPNRSHAFETKH U YNEOSENSCHN IP-BDTEUPN. ьФП NPTsEF VSHFSH IP-BDTEU, RPMHYUEOOOSCHK RP DHCP YMY RP IPCP CH UPEDYOEOSHI PPP, PPPoE Y YN RPDPVOSHCHI (OBRTYNET, RTY KHDBMЈOOPN DPUFHRE Yuete NPDEN). dTKHZIE NBYOSCH CH YOFETOEFE NPZHF KHUFBOBCHMYCHBFSH UPEDYOEOYE U LFK NBYOPK RP DPNEOOPNH YNEOY DBTSE OE OBFSH, YuFP IP-BDTEU YYNEOMUS.

CHTENS HUFBTECHBOYS BDTEUB (TTL) DMS DYOBNYUEULPK ЪBRYUY DEMBEFUS PYUEOSH NBMEOSHLIN (OE VPMEE DCHHI-FTI NYOHF), YOBYUE DTHZIE DNS-UTCHETSH RPNEUFSF EЈ CH UCHPK LY, LPZ DB POB YYNEOYFUS, YI LMYEOFSH DPMZP VHDHF RPMKHYUBFSH KHUFBTECHYHA YOZHPTNBGYA.

fBLYN PVTBBPN, UIENBFYUOP, RTPGEUU CHSHZMSDYF FBL:

  • TEZYUFTYTHENUS X RTPCHBKDETB DYOBNYUUEULPZP DNS, CHSHCHVYTBEN YNS DMS UCHPEK UYUFENSHY OBRYUSCHCHBEN EZP CH ZHTNKH ABOUT UBKFE.
  • lPOZHYZHTYTHEN UCHPK LPNRSHAFET FBL, YuFPVSH ON PVOPCHMSM DBOOSCH ABOUT ACCOUNTING RTPCHBKDETB DYOBNYUUEULPZP DNS.
  • FERETSH YICHOE L OBYEK NBYOE NPTsOP PVTBEBFSHUS RP ЪBDBOOPNH DPNOOOPNH YNEOY, RTYUEN OECHBTTSOP, LBLPK TEBMSHOSCHK IP-BDTEU YURPMSH'HEFUS UEKYUBU.

YuFP OHTsOP UDEMBFS?

DMS OBYUBMB OBDP PRTEDEMYFSHUS, LBL NSCH VHDEN YOZHPTNYTPCHBFSH UETCHET PV YYNEOOY IP. eUMY X ChBU ADSL, Y CHCH OE RPULKHRYMYUSH LHRYFSH NPDEN, URPUPVOSCHK TBVPFBFSH CH LBUEUFCHE TPHFETB, FP RPYUFY OBCHETOSLB ON UBN KHNEEF PVOPCHMSFSH UPPFCHEFUFCHHAEYE DBOOSCH VE CHUSLPZ P CHNEYBFEMSHUFCHB UP UFPTPOSH LPNRSHAFETB. rPDTPVOP ABOUT RTYNETBI LFP RPLBBOBOP ЪDEUSH.

EUMY CE CHCH RPDLMAYUEOSCH L UEFI YOSCHN URPUVPVPN, RTDEFUS KHUFBOPCHYFSH ABOUT UCHPEN LPNRSHAFETE RTPZTBNNH-LMYEOF DMS PVOPCHMEOYS DBOOSCHY OBUFTPIFSH ITS. rTPZTBNNNSCH FBLYE NPTsOP ULBUBFSH U UBKFPCH UPPFCHEFUFCHHAEYI RTPCHBKDETPCH DYOBNYUEULPZP DNS, FBN PVSHYUOP VSHCHBAF CHETUIY DMS TBOSHI PU, FBL YuFP ЪBDEKUFCHBFSH FBLHA U IENH RPD Linux YMY FreeBSD PVSHYUOP FTHDB OE UPUFBCHMSEF.

rTPCHBKDETSCH DYOBNYUEULZP DNS

fBLYI RTPCHBKDETCH UHEEUFCHHEF OENBMP. ABOUT YJVPMEE Y'CHEUFOSH Y'OYI:

lBTsDSCHK RTPCHBKDET RTEDPUFBCHMSEF UCHPY HUMKHZY RMBFOP. OP YUBUFSH HUMHZ VEURMBFOB. lFP PVSHYUOP PYUEOSH NBMEOSHLBS YUBUFSH, CHPNPTSOPUFY DYOBNYUEULPZP DNS NOPZP YYTE, OP OBN ICHBFYF. UPCHEFKHA CHOINBFEMSHOP POBBLPNYFSHUS U UPPFCHEFUFCHHAEYNY UBKFBNY, OBVPT VEURMBFOSHI HUMKHZ KH CHUEI UCHPK, ChPNPTSOP, ChBU ЪБЪБЪФЭТУХАФ ЛБЛИЕ-ФП ДПРПМОІСHOSHChПЪNPC OPUFFY.

RTYNET TEZYUFTBGYY

yFBL, TBUUNPFTYN TEZYUFTBGYA DPNEOOPZP YNEOY (DMS RTYNETB, ABOUT UETCHYUE DynDNS).

yBZ 1. UPЪDBOIE BLLBHOFB.

zPFPChP! FERTSH CHSHCHVTBOOPE chBNY DPNEOOPE YNS VHDEF CHUEZDB PDOPOBYUOP CHEUFY ABOUT chby IP-BDTEU, VE'PFOPUYFEMSHOP FPZP, LBLPC LFP BDTEU! b EUMY RTPEE, FP hBYE YNS FERETSH UBNEOSEF hBY IP.

The article is no longer relevant. Yandex is transferring everyone to Yandex.Connect. In the Connect API on this moment There is no ability to manage DNS records. The pdd.yandex API no longer works.
You can use the Telegram api to get dynamic ip. Instructions

I have long used the services of dyndns to connect from outside to a home file dump/torrent downloader on a free server, which has a dynamic IP from the provider. Although dyndns has been paying for this service for a long time for newly registered users, I used it for free, because I registered before they started asking for money for it. But the other day I received a letter that they can no longer provide this service to me for free and from next month I will have to pay for it. This did not suit me and I began to look for a way out of the current situation.

Since my domains are delegated to Yandex DNS, I started reading the manuals for their API and a solution was found. I'll tell you about it below.

To use Yandex api we need to get a token. Getting it is quite simple, just enter it in the browser.

Https://pddimp.yandex.ru/get_token.xml?domain_name=domen.ru

Where domen.ru is your domain delegated to Yandex. We enter the captcha and in the output we look for:

Token="XXXXXX"

Your token will be in quotes. Let's copy it somewhere, we'll need it a little later.
Now we need to add a subdomain to our domain, which will link to a machine with a dynamic IP. Go to https://pdd.yandex.ru, select the domain and click “DNS Editor” and add an A record for the domain there:

In the “Host” field, enter the subdomain, and in the “Record value” field, write any ip (later it will change when the ip of your car changes).

Now we need to get the id of our post. To do this, enter in the browser:

Https://pddimp.yandex.ru/nsapi/get_domain_records.xml?token=XXXXXX&domain=domen.ru

Where XXXXXXX is your token, and domen.ru is your domain delegated to Yandex.

In the output we look for the line with our entry myhome.domen.ru and in this line we find:

Id="1234567"

The id of the post is in quotes, so copy it somewhere.

Now we write the script on a car with a dynamic IP. The script will check the external IP of the car once every half hour and if it has changed, it will change the A-record on Yandex DNS.

# ee /usr/local/bin/dyndns.sh

#!/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin; export PATH DOMEN="domen.ru" # your domain delegated to Yandex SUB=myhome # subdomain TOKEN=XXXXXX # token RECID=1234567 # record id while true; do IP="curl -s http://ip..domen.ru dns1.yandex.ru | grep has | awk "(print $4)"` # replace myhome.domen.ru with your subdomain if [ $IP != $YAIP ] then curl -s "https://pddimp.yandex.ru/nsapi/edit_a_record.xml?token=$TOKEN&domain=$DOMEN&subdomain=$SUB&record_id=$RECID&content=$IP&ttl=1800" fi sleep 1800;

Change the variable values ​​according to the comments.

Making the script executable:

# chmod +x /usr/local/bin/dyndns.sh

And add the corresponding entry to cron:

# crontab -e @reboot /usr/local/bin/dyndns.sh

That's it, now after a reboot the script will run automatically. We reboot or run the script manually and check at https://pdd.yandex.ru whether the value of the entry for our subdomain has changed.

P.S. To make everything completely free, you don’t have to buy a domain but use a free domain in the .tk zone. You can get it on the website www.dot.tk

Greetings, brain engineers! Shouldn't we unite our Internet devices in the house using a DNS server made by with your own hands from the WiFi module and Foscam webcam interface? I think it will be interesting, so let's go!

Selected for this homemade products the Foscam webcam is controlled directly from a smartphone, has its own web interface, works in any browser and on any device, even with your phone’s 3G connection, third party applications does not require and is password protected.

Video streams from cameras are broadcast in separate windows, quickly and flawlessly, and under complete control.

Just a heads up - I AM NOT RESPONSIBLE for misuse or damage caused by this project in any way! You act at your own peril and risk!

What's for this brain project necessary:

  • web server with PHP support with a domain name,
  • wi-fi module Esp8266 ESP-01,
  • push button - 2 pcs.,
  • pull-up resistor 2k2 or similar - 2 pcs.,
  • USB-TTL adapter (for programming the wi-fi module) and several pin connectors (“female”),
  • voltage regulator Ams1117 3.3V (to reduce the voltage of 5V to 3.3V to power the wi-fi module),
  • power supply 5V 1-2A (preferably 2A),
  • in the first layout option: if there is enough space inside the power supply case, then the wi-fi module is placed inside this case,
  • in the second layout option: the power supply has a female USB connector, then you will have to add a male USB connector to the module board and use it to supply power,
  • broken USB flash drive,
  • updated Arduino IDE program
  • additionally: Foscam webcams for working with the web interface
  • to ensure: blinking LED, to indicate successful download and download waiting
  • internal server allowing WAN IP ( this version connects to an external site to obtain an IP: checkip.dyndns.org).

Step 1: Preparing the Wi-Fi module for programming

In order for the module to be programmable, it needs to be slightly modified:

  • solder two resistors - one to the CH-PD contact, the second to the RST, solder both free leads of the resistors to the 3.3V contact,
  • solder two push buttons - one between the GPIO0 and Ground pins, and the other between RST and Ground.

It is better to solder from the top side of the module board, so that the contacts on the bottom side are left for mounting pin connectors. If desired, the circuit can be assembled using a breadboard, but brain solder still more durable, although see for yourself.

In the next step, the power supply will be modified, but I warn you right away: the USB output of your computer is not suitable for powering the ESP module!!!

Step 2: Modifying the power supply - lowering the voltage from 5 to 3.3V

The 5V power supply should produce a “reliable” 1A, or better yet 2A, since the module is quite “gluttonous” during Wi-Fi signal transmission.

IN homemade We use an Ams1117 3.3V voltage regulator, because a voltage divider assembled from resistors will most likely “produce” too little current, and even if we get 3.3V to power the module, we will still be disappointed. And this regulator is an inexpensive and best solution.

I did not use the capacitor and resistor that according to the instructions should be added to the regulator, because it operates from a stable power source, and I will say that this brain option has been working reliably for several years.

pin 3 - 5V (orange wire)
pin 2 - 3.3V (yellow wire)
pin 1 - GND (two blue wires)

You can solder several wires with pin connectors to the contacts, thereby simultaneously obtaining two voltage sources of 5V and 3.3V, which is very useful when assembling on breadboard. In this case, do not forget to add two grounding wires, for +3 and +5V, and for reliability, fasten all the wiring with a plastic tie.

To connect these wires to the ESP module (which has male connectors), you will need intermediate wires with female pin connectors at the ends.

Step 3: Connecting the Wi-Fi module to the USB-TTL adapter and 3.3V voltage regulator

Connections (module - adapter - regulator)

GND — — — — GND- — — — GND
TX — — — — — RX
RX — — — — — TX
3,3 — — — — — — — — — — — — — 3,3

We connect the grounding contacts (Ground) of the voltage regulator, module and adapter together, connect the 3.3V coming from the regulator to the input of the ESP module.

Under no circumstances should we connect the ESP module to the 3.3V pin of the adapter, even if it has them, since this can damage the computer’s USB port, because it does not have protection against current of the same rating that is used in this brain work! And to power the ESP module, always use a power source with the required parameters.

You should know that some TTL-USB adapters have 5V logic circuit, which is not suitable for our craft, only 3.3V logic is needed, otherwise the ESP module will be damaged. The type of logic can be determined using a voltmeter by connecting its probes to the TX and Ground pins, and if necessary, the voltage can be reduced by adding a level shift or voltage divider.

Step 4: Setting Up Files on Web Hosting

Create a folder “/ip” (the name is case sensitive) in the root directory of your public_html folder, and unpack the /ip files into it with a resolution of 644.

The .htaccess restriction does not allow users to list files in this folder because it cannot be password protected, otherwise the ESP8266 module would not be able to access it and execute files inside it.

input.php and input2.php generate according to the browser URLs ip.txt and ip2.txt with the updated IP of the ESP8266 module, the current code supports 2 different locations, and to add something else you only need to edit these files.

To control the FOSCAM camera, you need to create a folder “/cam” (again, case sensitive) in the root directory of the public_html folder, and unpack /cam files into it with a resolution of 644. Protect this folder brain password, if cpanel is available on your server, then you can find the “password protection” icon and set a password that will be requested when you tell the browser to go to www.yourhost/cam, then a dialog box will pop up in any browser asking for this password, all this will protect access to cameras.

foscam.php contains the camera interface, as well as the date/time stamp of the IP files and the current IP location. By the date/time stamp you can see whether the module is working. In this case, the time zone may not be displayed correctly, since it shows the time on the server.

The IP can be changed manually, it will be recorded in ip.txt and ip2.txt, and to do this you need to enter the ip in the field and click update ip.

interface.png and interface2.png are transparent images specifying to the interface how the screen will be displayed. You need to edit foscam.php and set the value, static or ptz, corresponding to your FOSCAM camera. The default resolution is 320x240, but clicking on the control center opens only this camera with a better refresh rate at 640x480 resolution.

To edit foscam.php, you can use a code editor or an HTML editor that can work in WYSWYG mode.

During work brain boards The files ip.txt and ip2.txt will be automatically written, containing the updated ip of two locations where two different boards can operate. Every hour (or whenever you specify) the board will connect to the router via Wi-Fi, receive an IP address and register it in a txt file on the server. And even if the Internet connection is lost or the power is turned off, after these problems are resolved, the ip will be periodically updated.

Step 5: Setting up FOSCAM cameras and router

On the TP-LINK router configuration page:

We look at the settings in the photo, they will help to avoid a conflict when linking a MAC address and LAN-ip; the router will provide only assigned LAN-ip MAC addresses for this.

Virtual servers ( virtual servers) - you need to add the local IP of your camera and the corresponding ports.

We set the DHCP server to be enabled, and also check whether UpnP is enabled.

Can also be customized remote control your router, there is a corresponding firewall sub-item for the TP-Link router.

Do not change the default login, as the router must be public. Further in the corresponding brain fields should be set to 255.255.255.255 and the port is usually 8080.
On the FOSCAM camera settings page:

Name and password - you should set a new name and password, and do not forget to “find and replace” them in foscam.php instead of admin and password.

For “Basic Network settings” set: “Obtain IP from DHCP Server”.
In the Http Port item, set: 8081, 8082 8083 sequentially to your cameras.
In UPnP Settings set: Using UPnP to Map Port. This will help restore the connection after a power outage.

After setting up the router and cameras, in order for the settings to be updated, they should all be rebooted, the router first.

If the cameras and router are configured correctly, then they can be accessed remotely from your Wan IP address, for example this: http://187.34.157.22:8081. You can check your Wan IP at https://www.whatismyip.com/

Step 6: Coding and Programming the ESP8266 Module Using Arduino IDE

For programming homemade products you need to open the attached sketch in the Arduino IDE, and in the appropriate lines specify the ssid “//your wifi ssid” and the password “//your wifi pwd” of your WiFi router, as well as your host name “//your host without /IP” and the path to the “/ip” folder containing the server files; it does not need to be changed.

You may need to change the line

url += “input.php?ip=”;

which appears twice in the sketch, and if you have a second module, then simply change it to input2.php.

Before you start downloading the code, you must set the board type correctly; for this, select “Generic ESP8266” from the tools submenu, and if this is not the case, then add additional boards in the preferences.

To boot, you need to hold down the GPIO0 button, quickly press the RST button, and then release the previous one (GPIO0 button). Next, run compilation in the IDE and brain load.

If everything is going correctly, when you open the serial port monitor at 9600 baud (bit/s), you will see the following:

Connected To:
IP address: 192.168.0.103 (LAN IP)
Connected - Acquiring WAN IP:

connecting to
Requesting IP Update: /ip/input.php?ip=xxx.xxx.xxx.xxx
Ok

Step 7: Mounting the boards into the case

After checking homemade products To make it work, you need to place its electronics in a housing, thereby making it an independent, complete device.

If in the case you have chosen for brain games there is enough free space, then resistors and buttons can be connected as shown in the photo, but if you plan to reprogram it later, then you should not place the board inside the case.

First option: Placement inside the case
To do this, you need to open the case of the old power supply, unsolder the black (outgoing) wire with the connector, and then place the module board and voltage regulator in the case, having previously insulated them, and “power” them from the contacts to which the outgoing wire was soldered. You can insulate the components using suitable foam tape or hot glue.
The result should be a power supply, without any wires, and in this option The power supply can be 5V 1A.

Variation this method The layout may include placing the boards inside a power supply that has a female USB connector at the output. Then the boards should also be secured inside the case, insulated, and powered from the contacts of the USB connector. Thus, with this modified power supply you can still charge your phone, but the power supply must produce 5V 2A.

Option 2: Placed outside
If you have a non-working flash drive, the housing of which can accommodate boards homemade products, then you can use it.

You need to disassemble the flash drive, remove the memory board, and in its place place the WiFi module and voltage regulator, and power them through the USB connector of this flash drive. In this case, you will also need to trim the pin contacts of the module so that it fits into the flash drive housing. And NEVER CONNECT this modified flash drive to the USB port of your computer!

Then you need to connect the flash drive with the module inside to the power supply and check for a WiFi signal using your smartphone. In general, check the performance of the finished brain games You can use your browser by going to /cam/foscam.php of your server. And also, it should be updated with the current ip and date/time stamp.
That's all, I hope this information brain articles will be useful to you!

As a rule, the time that the system spends connecting to the DNS server when visiting web resources is small. Most often, those servers that the provider uses by default work stably and quickly. However, there are situations when standard DNS is not fast enough. In this case, you can try changing the server.

Google Public DNS

According to the developers themselves, this DNS can significantly speed up the loading of web pages. In order to use this server, in the connection settings you need to specify addresses 8.8.8.8 and 8.8.4.4 for the primary and secondary DNS, respectively.

If you are interested in servers or data storage systems, then Server City offers you to buy DELL, IBM servers, as well as data storage systems for favorable price. Here on the website server-city.ru you can read in more detail about all the services that the company offers.

Following suit Google, Yandex has developed its own alternative DNS server. In addition, the developers have added features family control in case there is a need to block potentially dangerous resources. To use DNS without filtering functions, you must enter the address 77.88.8.8 in the connection settings. If you enter the address 77.88.8.88, you can use the filtering functions for dangerous resources. If you enter the address 77.88.8.7, you will activate filtering of dangerous sites and porn resources.

This service is quite popular on the Internet and for good reason. OpenDNS allows you to use modern methods of Internet security, is fast and has many nice features, for example, the function of correcting typos in typed addresses.

The service has paid and free modes.

Free mode with standard settings available at the following addresses:

  • 208.67.222.222
  • 208.67.220.220

SkyDNS

This service is a leader on the Russian-language Internet in the field of security and filtering of unwanted content. As the developer himself assures, the service is used by tens of thousands of users, large companies, Internet providers, etc. Paid and free modes are available.

Connecting to the free mode is available after completing the registration procedure, which does not take much time. To use SkyDNS, you will be asked to download a small SkyDNS Agent application, or provide your IP. However, you can use the service without installing the application.

To do this, you will need to specify the DNS address 193.58.251.251.

In addition, to find a suitable DNS, you can use the appropriate software, of which there is a lot on the Internet.