Ugly date gos reg html. Removing delegation and deleting domains. Removing domains from Registries in international and foreign national domains

💖 Do you like it? Share the link with your friends

Monitoring your domain name renewal date is an action that cannot be underestimated. I already wrote about that, and now let's deal with another common problem— unexpected expiration of the domain name registration period. It would seem that all registrars today remind you of this in advance (and usually several times). But the problem is that these letters are either not read, or they somehow end up in spam. In general, not everyone is aware that their domain name registration is expiring. As a result, the site does not work, people do not understand why, and sometimes spend a lot of time trying to understand what is happening. Meanwhile, the domain name disappears from the DNS cache, and after a couple of days (or even earlier, depending on various factors), visitors stop accessing the site. Let's see how to monitor the expiration date of a domain name registration. Naturally, with a bash script.

How to get the registration date of a domain name

The simplest option is to use the global whois database. It stores information about domain names, such as organization, responsible person, contact information, registration date and registration expiration date. And this is exactly what we need. Let's take some popular domain as an example. Let it be yandex.ru. This is the information stored in the whois database about this domain:

$ whois yandex.ru % By submitting a query to RIPN"s Whois Service % you agree to abide by the following terms of use: % http://www.ripn.net/about/servpol.html#3.2 (in Russian) % http://www.ripn.net/about/en/servpol.html#3.2 (in English). domain: YANDEX.RU nserver: ns1.yandex.ru. 213.180.193.1, 2a02:6b8::1 nserver: ns2.yandex.ru. 93.158.134.1, 2a02:6b8:0:1::1 state: REGISTERED, DELEGATED, VERIFIED org: YANDEX, LLC. registrar: RU-CENTER-RU admin-contact: https://www. nic.ru/whois created: 1997.09.23 paid-till: 2017.10.01 free-date: 2017.11.01 source: TCI Last updated on 2017.01.03 05:46:31 MSK

The field that interests us is “paid-till”, this is the date until which we have paid for the domain.

We will monitor the renewal date of a domain name in approximately the same way as monitoring a certificate, but much simpler. We get data about the domain, look for the field containing the registration end date, if it is present (if the whois data for this domain is not closed), get this date, get today's date and display the difference in days. If you wish, you can add sending a letter if, say, there are less than 30 days left before the end of registration. But it's not that simple. Because there are at least three types of registration expiration records. The first one looks like this:

Paid-till: 2017.10.01

The second one looks like this:

Registrar Registration Expiration Date: 2020-09-13T21:00:00-0700

And the third one looks like this:

Registry Expiry Date: 2018-05-11T04:00:00Z

And we, accordingly, need to provide for all three options. Or, if a fourth one is encountered, then a fourth one too. For now, let's deal with these three.

This is what the script looks like:

#!/bin/bash # If the parameter is not specified, display a hint and exit if [ "$1" == "" ] then cat less/reg/?mode=auth">Login



  • tell friends