Olej писал(а): ↑16 мар 2023, 17:08
Можно установить пакет
Но для меня открылись удивительные вещи в whois
Вот для этого хоста (этот вот форум):
Код: Выделить всё
olej@R420:~/2023/own.BOOKs/NatioLang/natiolang.cod/regex.cod$ host linux-ru.ru
linux-ru.ru has address 90.156.230.27
linux-ru.ru mail is handled by 10 mx1.timeweb.ru.
linux-ru.ru mail is handled by 10 mx2.timeweb.ru.
Сравним информацию, выдаваемую по URL и по IP:
Код: Выделить всё
olej@R420:~/2023/own.BOOKs/NatioLang/natiolang.cod/regex.cod$ whois linux-ru.ru
% TCI Whois Service. Terms of use:
% https://tcinet.ru/documents/whois_ru_rf.pdf (in Russian)
% https://tcinet.ru/documents/whois_su.pdf (in Russian)
domain: LINUX-RU.RU
nserver: ns1.timeweb.ru.
nserver: ns2.timeweb.ru.
nserver: ns3.timeweb.org.
nserver: ns4.timeweb.org.
state: REGISTERED, DELEGATED, UNVERIFIED
person: Private Person
registrar: TIMEWEB-RU
admin-contact: http://timeweb.name/contact-admin
created: 2018-07-03T18:55:08Z
paid-till: 2023-07-03T18:55:08Z
free-date: 2023-08-03
source: TCI
Last updated on 2023-03-16T14:36:31Z
Код: Выделить всё
olej@R420:~/2023/own.BOOKs/NatioLang/natiolang.cod/regex.cod$ whois 90.156.230.27
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf
% Note: this output has been filtered.
% To receive output for a database update, use the "-B" flag.
% Information related to '90.156.230.0 - 90.156.230.255'
% Abuse contact for '90.156.230.0 - 90.156.230.255' is 'abuse@timeweb.ru'
inetnum: 90.156.230.0 - 90.156.230.255
netname: TW-VDS-KZ
geofeed: https://geofeed.timeweb.net/geofeed.csv
country: KZ
admin-c: TMWB-RIPE
tech-c: TMWB-RIPE
abuse-c: TMWB-RIPE
status: ASSIGNED PA
mnt-by: TIMEWEB-MNT
created: 2022-12-14T06:39:43Z
last-modified: 2022-12-19T06:26:34Z
source: RIPE
role: TimeWeb Co. Ltd. Role Account
address: 22/2 lit.A,Zastavskaya str.
address: 196006, Saint-Petersburg
address: Russia
phone: +7 812 2481081
phone: +7 495 0331081
abuse-mailbox: abuse@timeweb.ru
admin-c: AAB215-RIPE
admin-c: KRON
tech-c: AAB215-RIPE
tech-c: AA39263-RIPE
tech-c: AG26308-RIPE
tech-c: KRON
nic-hdl: TMWB-RIPE
mnt-by: TIMEWEB-MNT
created: 2008-03-18T10:36:42Z
last-modified: 2022-03-05T06:49:37Z
source: RIPE # Filtered
% Information related to '90.156.230.0/24AS48716'
route: 90.156.230.0/24
origin: AS48716
mnt-by: TIMEWEB-MNT
created: 2022-12-19T06:25:47Z
last-modified: 2022-12-19T06:25:47Z
source: RIPE
% This query was served by the RIPE Database Query Service version 1.106 (SHETLAND)
Как видно - это существенно
разная информация
А пакет Python просто при запросе информации по IP - просто слетает по ошибке:
Код: Выделить всё
>>> domain = whois.query("90.156.230.27")
we DONT have 27
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/olej/.local/lib/python3.10/site-packages/whois/__init__.py", line 233, in query
tld, dl = fromDomainStringToTld(domain, internationalized, verbose)
File "/home/olej/.local/lib/python3.10/site-packages/whois/__init__.py", line 96, in fromDomainStringToTld
tld = filterTldToSupportedPattern(domain, d, verbose)
File "/home/olej/.local/lib/python3.10/site-packages/whois/_0_init_tld.py", line 47, in filterTldToSupportedPattern
raise UnknownTld(msg)
whois.exceptions.UnknownTld: The TLD 27 is currently not supported by this package. Use validTlds() to see what toplevel domains are supported.
>>>
И нормально отвечает при запросе по имени
Код: Выделить всё
>>> domain = whois.query("linux-ru.ru")
we have ru
>>> domain2.__dict__
{'name': 'asiga.com', 'tld': 'com', 'registrar': 'Webcentral Group Limited dba Melbourne IT', 'registrant_country': 'AU', 'creation_date': datetime.datetime(2005, 8, 23, 18, 15, 38), 'expiration_date': datetime.datetime(2023, 8, 23, 18, 15, 38), 'last_updated': datetime.datetime(2022, 8, 15, 15, 59, 5), 'status': 'clientTransferProhibited https://icann.org/epp#clientTransferProhibited', 'statuses': ['clientTransferProhibited https://icann.org/epp#clientTransferProhibited', 'clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited'], 'dnssec': False, 'name_servers': ['ns1.linode.com', 'ns2.linode.com', 'ns3.linode.com', 'ns4.linode.com', 'ns5.linode.com'], 'registrant': '', 'emails': ['abuse@melbourneit.com.au']}
>>>