Matty9191 / dns-domain-expiration-checker

Send notifications when DNS domains are about to expire.
GNU General Public License v2.0
96 stars 22 forks source link

CZ and SK domain dont work #1

Open pavkamlc opened 6 years ago

pavkamlc commented 6 years ago

On Centos 7 may be problem with date calculation.

[root@zabbix externalscripts]# ./dns-domain-expiration-checker.py --domainname brno.com Unable to calculate the expiration days [root@zabbix externalscripts]# ./dns-domain-expiration-checker.py --domainname brno.cz Unable to calculate the expiration days [root@zabbix externalscripts]# ./dns-domain-expiration-checker.py --domainname brno.sk Unable to calculate the expiration days [root@zabbix externalscripts]#

Matty9191 commented 6 years ago

Can you try running the program again? It looks like the expire string used by a number of registrars changed again.

Matty9191 commented 6 years ago

FWIW: It's working OK now with the change I just merged:

dns-domain-expiration-checker.py --domainname brno.com --interactive Domain Name Registrar Expiration Date Days Left brno.com GoDaddy.com, LLC 2019-05-15 04:00:00 343

pavkamlc commented 6 years ago

Hello Matty, I tried, but for CZ registrar is expiration string "expire:". When I add it into script, I can use this command: ./dns-domain-expiration-checker.py --domainname google.cz --interactive

This is output on my network: [root@zabbix externalscripts]# whois brno.cz [Querying whois.nic.cz] [whois.nic.cz] % (c) 2006-2018 CZ.NIC, z.s.p.o. % % Intended use of supplied data and information % % Data contained in the domain name register, as well as information % supplied through public information services of CZ.NIC association, % are appointed only for purposes connected with Internet network % administration and operation, or for the purpose of legal or other % similar proceedings, in process as regards a matter connected % particularly with holding and using a concrete domain name. % % Full text available at: % http://www.nic.cz/page/306/intended-use-of-supplied-data-and-information/ % % See also a search service at http://www.nic.cz/whois/ % % % Whoisd Server Version: 3.10.2 % Timestamp: Wed Jun 13 10:31:27 2018

domain: brno.cz registrant: MESTOBRNO-CZ nsset: NSSBRNO-CZ registrar: REG-INTERNET-CZ registered: 07.11.1997 01:00:00 changed: 03.07.2015 12:35:41 expire: 20.10.2025

contact: MESTOBRNO-CZ org: Statutární město Brno MMB name: David Menšík address: Dominikánské nám. 1 address: Brno address: 60167 address: CZ registrar: REG-INTERNET-CZ created: 04.04.2011 02:21:16 changed: 29.05.2018 14:14:20

nsset: NSSBRNO-CZ nserver: ns1.brno.cz (185.62.110.25) nserver: ns2.brno.cz (185.62.110.26) nserver: ns3.brno.cz (18.196.5.32) tech-c: BRNO-CZ registrar: REG-INTERNET-CZ created: 28.07.2010 09:19:05 changed: 29.03.2018 11:15:21

contact: BRNO-CZ org: Statutární město Brno MMB name: David Menšík address: Dominikánské nám. 1 address: Brno address: 60167 address: CZ registrar: REG-INTERNET-CZ created: 28.07.2010 09:17:11 changed: 07.06.2018 07:20:54

Best regards, Pavel.

út 5. 6. 2018 v 21:45 odesílatel Matty notifications@github.com napsal:

FWIW: It's working OK now with the change I just merged:

dns-domain-expiration-checker.py --domainname brno.com --interactive Domain Name Registrar Expiration Date Days Left brno.com GoDaddy.com, LLC 2019-05-15 04:00:00 343

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Matty9191/dns-domain-expiration-checker/issues/1#issuecomment-394836374, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNvbUd3g6hFjjwvOy5EO8Q2b9u0XCJqks5t5t_ggaJpZM4UTZU6 .

pfilbin90 commented 5 years ago

Hello @Matty9191 - just wanted to let you know that I have tried this today and I am experiencing the same issue that @pavkamlc has. ".co.uk" and ".ca" domains were not working for me. Can you please check this for me? Thanks

pfilbin90 commented 5 years ago

I would also like to ask about speed. I am adding in a domain file with about 15 different domains and it appears to be taking a really long time. About 15-20 minutes before the script is completed. Is there any way to hasten its completion?

Matty9191 commented 5 years ago

It looks like I need to add another expire string to the mix. I'll try to get a new version uploaded this week to address this issue.

Matty9191 commented 5 years ago

@pfilbin90 can you add "--sleeptime 0" to your command line? By default the script will wait 60-seconds between queries to avoid triggering the registrars DOS logic.

pfilbin90 commented 5 years ago

Thank you, that fixed my issue with the speed. Looking forward to the update with the new expire strings!

Matty9191 commented 5 years ago

Can you try the version I just checked in? I added a new expire string and it looks like that fixed the issue:

$ ./dns-domain-expiration-checker.py --domainname google.cz --interactive Domain Name Registrar Expiration Date Days Left google.cz Unknown 2019-07-22 00:00:00 200

pfilbin90 commented 5 years ago

I'm still getting "Unable to calculate the expiration days". I'm trying with ".co.uk" and ".ca" domains.

Matty9191 commented 5 years ago

Can you paste the complete command line you are using? Let me debug further.

pfilbin90 commented 5 years ago

python dns-domain-expiration-checker.py --interactive --domainname google.co.uk --sleeptime 0

I get the response:

Domain Name                Registrar             Expiration Date                 Days Left
Unable to calculate the expiration days
Matty9191 commented 5 years ago

I uploaded another variant with the co.uk expiration string. Can you try 9.0?

pfilbin90 commented 5 years ago

It is working now, thank you so much. I have one last question. Is there a flag for SMTP username and password if I'm using an SMTP server that requires authentication?

Matty9191 commented 5 years ago

Let me read through the smtplib source code to see if they accept a username and password.

pfilbin90 commented 5 years ago

Hello again. Looks like I have run into 1 more issue. This script does not work with .org domains.

For example python dns-domain-expiration-checker.py --interactive --domainname wikipedia.org --sleeptime 0

Will return the following:

Traceback (most recent call last):
  File "dns-domain-expiration-checker.py", line 244, in <module>
    main()
  File "dns-domain-expiration-checker.py", line 229, in main
    expiration_date, registrar = make_whois_query(conf_options["domainname"])
  File "dns-domain-expiration-checker.py", line 90, in make_whois_query
    return(parse_whois_data(whois_data))
  File "dns-domain-expiration-checker.py", line 103, in parse_whois_data
    expiration_date = dateutil.parser.parse(line.partition(": ")[2], ignoretz=True)
  File "/home/centos/Envs/dns-domain-expiration-checker/lib/python2.7/site-packages/dateutil/parser/_parser.py", line 1356, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/home/centos/Envs/dns-domain-expiration-checker/lib/python2.7/site-packages/dateutil/parser/_parser.py", line 651, in parse
    raise ValueError("String does not contain a date:", timestr)
ValueError: (u'String does not contain a date:', '')
pfilbin90 commented 5 years ago

I apologize for continually bombarding you. I am also needing ".com.au" domains which are experiencing the "Unable to calculate the expiration days" error.

pfilbin90 commented 5 years ago

I just wanted to update you on the ".org" domain. It appears something is wrong with the Linux server that I'm running the script on. If I run it on a different server (with an updated version of Python), it works just fine.

Something about Python 2.7.5 doesn't like the date value that is being returned. However when I run it on a machine with Python 2.7.10 it works just fine.

mukesh120 commented 5 years ago

Hey Matty,

I am unable to run the file, can you please tell me How I can run this file. I needed it badly but because I am a noob I don't know how to use it. Even the installation process is difficult for me to follow.

mrpackethead commented 4 years ago

Any chance of a requirements.txt ? That would make it easier for folks to install.

copenhaus commented 4 years ago

another noob giving a shot at this...yes, I agree. We need steps for "pre-requisite" from a fresh Ubuntu (insert your flavor) install...thanks...

Matty9191 commented 4 years ago

Those are reasonable suggestions. I will try to get the repo updated this weekend.