Code Monkey home page Code Monkey logo

domain-check-2's Introduction

Domain Expiration Check Shell Script

A simple shell script to display or notify the user via email about domain status and expiry date.

Installation:

Use the curl or wget command to grab script as follows:

$ wget https://raw.githubusercontent.com/nixcraft/domain-check-2/master/domain-check-2.sh
## [ sample domain list for testing purpose ] ##
$ wget https://raw.githubusercontent.com/nixcraft/domain-check-2/master/domain-list.txt 
## [ install it in /usr/local/bin dir ] ##
$ sudo cp -vf domain-check-2.sh /usr/local/bin/domain-check-2
$ sudo chmod +x /usr/local/bin/domain-check-2.sh

Usage:

Run it as follows:

$ domain-check-2 -d google.com
$ domain-check-2 -d cyberciti.biz
$ domain-check-2 -f domain-list.txt 

Sample outputs:

Domain                              Registrar                                      Status   Expires     Days Left
----------------------------------- ---------------------------------------------- -------- ----------- ---------
nixcraft.com                        GoDaddy.com, LLC                               Valid    10-may-2023   2022 
google.org                          MarkMonitor Inc.                               Valid    20-oct-2018   359  
google.net                          MarkMonitor Inc.                               Valid    15-mar-2018   140  
google.info                         MarkMonitor Inc.                               Valid    31-jul-2018   278  
cyberciti.biz                       GoDaddy.com, Inc.                              Valid    30-jun-2024   2439 
google.in                           MarkMonitor Inc. (R84-AFIN)                    Valid    14-Feb-2018   111  
google.co.in                        MarkMonitor Inc. (R84-AFIN)                    Valid    23-Jun-2018   240  
google.us                           MarkMonitor, Inc.                              Valid    18-apr-2018   174  
google.uk                           Markmonitor Inc.                               Valid    11-Jun-2018   228  
google.co.uk                        Markmonitor Inc.                               Valid    14-Feb-2018   111  
google.jp                           Google                                         Valid    31-may-2018   217  

google.cz                           REG-MARKMONITOR                                Valid    22-jul-2018   269  
google.pl                           Markmonitor, Inc.                              Valid    18-sep-2018   327  
google.co                           MARKMONITOR, INC.                              Valid    24-Feb-2018   121  
google.ru                           RU-CENTER-RU                                   Valid    04-mar-2018   129  
google.blog                         MarkMonitor Inc                                Valid    19-aug-2018   297  
linux.cafe                          OVH SAS                                        Valid    14-nov-2018   384  
google.md                           Google Inc.                                    Valid    02-may-2018   188  
google.co                           MARKMONITOR, INC.                              Valid    24-Feb-2018   121  
dotmobi.mobi                        CSC Corporate Dom                              Valid    11-may-2018   197  
google.me                           MarkMonitor Inc.                               Valid    13-jun-2018   230  
google.us                           MarkMonitor, Inc.                              Valid    18-apr-2018   174  
google.su                           RUCENTER-SU                                    Valid    15-oct-2018   354  
youtube.tv                          MARKMONITOR INC.                               Valid    14-aug-2018   292  
abc.xyz                             MarkMonitor, Inc (TLDs)                        Valid    20-mar-2025   2702 
google.se                           MarkMonitor Inc                                Valid    20-oct-2018   359  
google.dk                           DK Hostmaster A/S                              Valid    31-mar-2018   156

Setup Unix/Linux cron job as follows to get email notification to send expiration notices:

@daily /path/to/domain-check-2.sh -f /path/to/your-domains.txt -e [email protected]

Getting help

$ domain-check-2.sh -h
Usage: domain-check-2.sh [ -e email ] [ -x expir_days ] [ -q ] [ -a ] [ -h ]
          {[ -d domain_namee ]} || { -f domainfile}

  -a               : Send a warning message through email 
  -d domain        : Domain to analyze (interactive mode)
  -e email address : Email address to send expiration notices
  -f domain file   : File with a list of domains
  -h               : Print this screen
  -s whois server  : Whois sever to query for information
  -q               : Don't print anything on the console
  -x days          : Domain expiration interval (eg. if domain_date < days)

Authors:

domain-check-2's People

Contributors

blink69 avatar eaydin avatar kode29 avatar minitram avatar nixcraft avatar sadeqn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

domain-check-2's Issues

No show domain name

Hi,

i don't know what happen it not show domain name like photo, with old file .txt it ok but new file .txt it not work. how i can fix
Thanks.
10-29-2021 11-34-57 AM

attempting to check my domains and receive command not found

I have a list of .com, .net, and .tk domains but it doesn't seem to poll anything. just print out a bunch of stuff like,

Domain                              Registrar                                      Status   Expires     Days Left
----------------------------------- ---------------------------------------------- -------- ----------- ---------
domain-check: line 298: -h: command not found
domain-check: line 304: -h: command not found
domain.net                     Unknown                                        Unknown  Unknown     Unknown
domain-check: line 298: -h: command not found
domain-check: line 304: -h: command not found
domain.tk                      Unknown                                        Unknown  Unknown     Unknown
...

I tried looking for that line but I'm not sure where it's referring to.

Please add support for .nl domains

When checking a .nl domain (for example google.nl) it has all ways status unknown. Like it is not registered, but in fact it is. Can you fix this?

.ca no longer works, hangs

Issuing this command just hangs (exampledomain.ca exists and has valid WHOIS information) :
domain-check-2 -d exampledomain.ca

The same domain returns valid information using whois :
whois exampledomain.ca

The relevant line in the output is :
Registry Expiry Date: 2021-05-16T04:00:00Z

please add domain .id (web.id / .id / .sch.id / .my.id / .ac.id / .co.id )

Would be great to see this nice script working with all ccTLD .ID (indonesian domains, such as .id / .web.id / .sch.id / .my.id / co.id)
I am not sure I understand what exactly to add, but it looks not too complicated, so I allow myself to post this as a feature request on the issue.

there google.co.id register detail, hopefully can help to add this feature:

whois google.co.id
Domain ID: PANDI-DO166626
Domain Name:google.co.id
Created On:2004-12-18 13:33:21
Last Updated On:2020-01-30 04:57:45
Expiration Date:2020-09-01 23:59:59
Status:clientTransferProhibited
Status:serverTransferProhibited
Status:clientUpdateProhibited
Status:clientDeleteProhibited
Status:serverDeleteProhibited
Status:serverUpdateProhibited
Status:serverTransferProhibited
Status:serverRenewProhibited

Sponsoring Registrar PANDI ID:digitalreg
Sponsoring Registrar Organization: Digital Registra
Sponsoring Registrar City: Sleman
Sponsoring Registrar State/Province: Yogyakarta
Sponsoring Registrar Postal Code:55281
Sponsoring Registrar Country: ID
Sponsoring Registrar Phone:0274882257
Sponsoring Registrar Contact Email:[email protected]
Name Server:ns1.google.com
Name Server:ns2.google.com
Name Server:ns3.google.com
Name Server:ns4.google.com
DNSSEC: Unsigned

added support for 32 tlds

3 # Version 2.19 - cda
14 # Added support for 32 tlds - 05.07.2020
15 # TLDs added:
16 # adult business catering coffee company cooking country domains email enterprises farm finance foundation holiday
17 # industries international investments kitchen legal lgbt menu online recipes restaurant services sex shop site
18 # store ventures xxx XXX
domain-check-2.txt

Sorry, if I did this wrong. Really need to learn how to use git/github.

no whois in (/bin:/usr/bin:/usr/local/bin:/usr/local/ssl/bin:/usr/sfw/bin)

Hello,

I have installed the script on CentOS 8.
During the installation everything was well.
But when I put a command for check is not working.
You can see the output, is like whois is not configured.

Thanks for your help

[root@localhost ~]# domain-check-2 -d google.com
which: no whois in (/bin:/usr/bin:/usr/local/bin:/usr/local/ssl/bin:/usr/sfw/bin)
which: no mail in (/bin:/usr/bin:/usr/local/bin:/usr/local/ssl/bin:/usr/sfw/bin)

Domain                              Registrar                                      Status   Expires     Days Left
----------------------------------- ---------------------------------------------- ------
/usr/local/bin/domain-check-2: line 303: -h: command not found
/usr/local/bin/domain-check-2: line 309: -h: command not found
google.com                          Unknown                                        Unknown  Unknown     Unknown

Capture d’écran 2020-06-05 à 12 22 26

Script give error sendmail

Hello,
the script works correctly except that sending mail does not work.

Here is the error:
./domain-check-2.sh -a -f /home/userwho/domain-list.txt -q 30 -e [email protected] /root/domain-check-2.sh: ligne 847: -s : commande introuvable

Thank you for your support.

Added .rs domains support (Serbia)

elif [ "${TLDTYPE}" == "rs" ]; # for .rs domain
then
        tdomdate=`cat ${WHOIS_TMP} | ${AWK} '/Expiration date:/ { print $3 }'`
        tmon=`echo ${tdomdate} | ${CUT} -d'.' -f2`
           case ${tmon} in
                 1|01) tmonth=jan ;;
                 2|02) tmonth=feb ;;
                 3|03) tmonth=mar ;;
                 4|04) tmonth=apr ;;
                 5|05) tmonth=may ;;
                 6|06) tmonth=jun ;;
                 7|07) tmonth=jul ;;
                 8|08) tmonth=aug ;;
                 9|09) tmonth=sep ;;
                 10) tmonth=oct ;;
                 11) tmonth=nov ;;
                 12) tmonth=dec ;;
                 *) tmonth=0 ;;
           esac
        tyear=`echo ${tdomdate} | ${CUT} -d'.' -f3`
        tday=`echo ${tdomdate} | ${CUT} -d'.' -f1`
        DOMAINDATE=`echo $tday-$tmonth-$tyear`

Please add support for .de domains

WOuld be great to see this nice script working with .de domains.
I am not sure I understand what exactly to add, but it looks not too complicated, so I allow myself to post this as a feature request... thanks!

Suggest to add support for id extension

Hi there,

You can add support for .id extension

Whois server = whois.id

Registrar pattern
REGISTRAR=cat ${WHOIS_TMP} | ${AWK} -F':' '/Registrar Organization:/ && $0 != "" { REGISTRAR=substr($0,36,32) } END { print REGISTRAR }'``

Expired date pattern
cat ${WHOIS_TMP} | ${AWK} '/Expiration Date:/ { print $3 }'

Thank you

Can you please add the support for IL domains?

Hi all,

I downloaded your script and it works great but my problem is when I ran query to an IL Domain I get no results. When I query a COM domain I get results. Can you tell me or add the IL domain extension to your script. It would be very helpful for me.
Thanks.

Elad.

Add the whois package to the dependencies

Hi there,

if you get the following error:

./domain-check-2.sh: line 303: -h: command not found

you may need to install whois

apt install whois

@click0 , the same error appears with the fork you maintain, could you please add a line to the doc?

What about allowing issue submission directly to your fork? (I'm not familiar with Github but it seems to be possible: https://stackoverflow.com/a/16406283)

Please add support .kz zone

i can't check KZ zone domains, please you can add?

bash domain-check-2.sh -d google.kz

Domain                              Registrar                                      Status   Expires     Days Left
----------------------------------- ---------------------------------------------- -------- ----------- ---------
google.kz                          Unknown                                        Unknown  Unknown     Unknown

@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.

@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 (4c3b2fe and ead6a67) and my script still works without any changes. Here is the updated screenshot from my script:
image

Originally posted by @tdulcet in #25 (comment)

Unknown

Hi,
I got error Unknown
i think some thing happen with whois.
how can i process for this.
Thanks
1
.

.ro domains are giving wrong results

First of all, you guys are doing an awesome job and thank you so much for all your work! :)

The issue I encountered is pretty simple, when checking .ro domains, I get a wrong expiration date:

[root@srv ~]# domain-check-2 -d google.ro
Domain Registrar Status Expires Days Left


google.ro MarkMonitor Inc. Expired -2458480
[root@srv ~]#

Have any idea if this is related to my server or maybe is something that can be fixed on the script code?

Thanks again for everything - have a good one and happy holidays!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.