domain-check-2 icon indicating copy to clipboard operation
domain-check-2 copied to clipboard

Fixed .pl domain support and added support for .ua/.cn/.io domains.

Open click0 opened this issue 6 years ago • 5 comments

Fixed .pl domain support and added support for .ua/.cn/.io domains.

click0 avatar Feb 11 '19 22:02 click0

I was able to rewrite the main part of this script that outputs the table (about 600 lines of code) in just 70 lines! My script works with all the TLDs currently supported by this script, except .kz, which does not have a whois server. Since I did not hard code any TLDs it should automatically work with all the TLDs that have a whois server and provide the expiration date. Here is the output from my script for the example domains and all the domains in the domain-list.txt file:

image

I have been testing it the last few months as people have been adding support for additional TLDs to this script and it has worked for these TLDs without any changes. The code for my script is available here for testing. I incorporated it into my larger Remote Servers Status Monitoring Script, which also supports domain expiry reminder notifications.

Some differences with my script:

  • Some TLDs do not provide the registrar. This script shows the registrant instead, which may be confusing for users. My script just says "Unknown".
  • This script has a status column to indicate if the domain is "Valid", "Expiring" or "Expired". My script outputs the expiration date and days left in green, yellow or red to indicate that.
  • This script only outputs the expiration date in a static format. My script outputs the expiration date and time in the current time zone and local format.
  • My script typically does not require any changes as new TLDs are added or when existing TLDs change their expiration date format.
  • My script has better error handling and will show any errors from the whois commands.
  • I fixed all the bugs found by ShellCheck.
  • If provided a domain-list.txt file, my script removes duplicate domains. The domain-list.txt file provided in this repository currently lists google.us and google.co twice.

I was not able to provide the output from this script for comparison, since the domain file feature is currently broken in this PR.

I welcome any feedback on my script and feel free to use any of it in this PR. Please let me know if you find a TLD that should work with my script but does not.

tdulcet avatar Jun 14 '19 09:06 tdulcet

@tdulcet It doesn't work for me, after run it displays date: wrong date in my language (Polish).

hawkeye116477 avatar Jun 16 '19 11:06 hawkeye116477

@hawkeye116477 Try adding export LC_ALL=en_US.UTF-8 to the top of the script. That should make the date commands input/output the dates in English.

Edit: I tested it again with the two new TLDs that were added to this script (https://github.com/nixcraft/domain-check-2/pull/25/commits/4c3b2fee985b8c35f7b23a3e4899dc3818a521ee and https://github.com/nixcraft/domain-check-2/pull/25/commits/ead6a678f434a1f27a24fbaf9fe629362b6ccb7c) and my script still works without any changes. Here is the updated screenshot from my script: image

tdulcet avatar Jun 17 '19 10:06 tdulcet

Ok, now works :smile:

hawkeye116477 avatar Jun 27 '19 20:06 hawkeye116477

hmm, sorry, new to github, how do I upload my modified code? I've added and modified some TLDs.

copenhaus avatar Feb 20 '21 09:02 copenhaus