Which of the following commands can be used to find out when a domain name expires

  1. What's My DNS?
  2. DNS Tools
  3. Domain Expiry

There are many times that knowing when a domain name is going to expire is useful. This can be determined by finding the expiration date and calculating how long it is until that date.

How do you check the expiry date of a domain name?

Checking the expiration date of a domain name is an easy process, by using the whatsmydns.net domain name expiry checker tool you can quickly and easily see the expiry date of a domain.

When will a domain name expire?

The domain expiry tool provides the specific date which a domain name will expire as well as automatically calculates how many years, months and days this will be.

What domain names can have their expiry date checked?

Most domain names can be checked, however in some cases it is unknown for various technical reasons.

Some examples: google.com, wikipedia.org, apple.com, youtube.com, amazon.com

Why would you want to check when the expiration date of a domain name is?

There are many reasons that you may wish to know when domain name is going to expire. Some of these reasons may include:

  • If you are the owner of the domain name and wish to renew it.
  • If you are not the owner and would like to register it once it expires.
  • To extend the expiry date of an existing domain name.
  • To ensure you have enough time to transfer to another domain registrar. Some domains are now allowed to be transferred within a certain time before expiry.
  • and many more!

How long do domain names take to expire?

Depending on the type of domain name, they can take different periods to expire after registration or renewal. Some domain names have a minimum registration period of 2 years, however it is most common that they are registered for only 1.

How long can a domain name be registered for?

Many domain names can be registered for longer than the minimum period and can even be renewed for up to a maximum of 10 years.

What happens when a domain name expires?

When a domain name expires, it will typically stop operating and any associated services will cease to function. This may include website access as well as the sending and receiving email.

Can you recover a domain which has expired?

Typically, you have a period from 30 to 90 days to re-activate an expired domain name before it is released to be registered again. However, it should be known that in most cases it can be a costly and sometimes lengthy process and is cheaper to make sure to renew before expiry.

The shell is an interface that helps users to operate the system through different commands, scripts, and utilities provided by Linux and Unix-based operating systems.

For most of the Linux distros, Bash shell is the popular and default shell. You can identify your current shell using the following command.

$ echo $SHELL

A domain is the identification string that is used to uniquely address your websites within the internet. When you buy the domain, the domain service provider will provide a domain for a limited period of time and need to renew it once it expires. Many online tools can be found to check the validity of the domain but also you can check it using the terminal. In this article, we will create a bash shell script that gives info about the validity of the domain.

We will use the whois command-line tool to check the domain expiry date. The whois command will return the detailed information on the domain we then need to parse the date from it using the grep command to view the expiration date.

$ whois google.com | egrep -i "Expiration | Expire on"

Which of the following commands can be used to find out when a domain name expires

Now, let's ready the shell script that shows us the expiry date of the domain. First, create and open the file domaincheck.sh in your preferred editor. The editor will create the new file for you if it does not exist on write and quit the file.

$ vim domaincheck.sh

The shell script always starts with #!bin/bash. Copy and paste the following script in your script.

#!/bin/bash

#Specify all the domains you want to check
DOMAINS="google.com dribbble.com facebook.com youtube.com"

current_epoch=`date '+%s'`
for dm in $DOMAINS
do
  expiry_date=`whois $dm | egrep -i "Expiration Date:|Expires on"| head -1 | awk '{print $NF}'`
  echo -n " $dm - Expires on $expiry_date "
  expiry_epoch=`date --date="$expiry_date" '+%s'`
  epoch_diff=`expr $expiry_epoch - $current_epoch`
  days=`expr $epoch_diff / 86400`
  echo " $days days remaining. "
done

In the above script, I have declared the variable that contains a list of domains and also the variable that contains the current time value in the epoch. The date command is formatted to Unix epoch time using the +%s formatting option and wraps the command with ` ` so that output of the command won’t be displayed on the terminal.

Next, I have used a for loop to get each domain name from DOMAINS. Inside the loop I have used the whois command to fetch info on the domain piping the output using egrep with -i to filter the specific text, head with -1 to print only the first line of the output, and awk command to get the last field. With this, you will be able to fetch the date from the whois command output which is assigned to the variable name expiry_date. The awk is the popular scripting language used for formatting the data and creating the reports. Then, I have printed the date using the echo command to view the corresponding domain expiry date.

In the next line, I have parsed the string to date using the date command with --date option and format it into Unix epoch time. The expr command will do the basic operations like addition, subtraction, division, etc, and subtracting expiry_epoch value with current_epoch value will result in the remaining time. Then convert the epoch time into day by dividing it by 86400. Lastly, print the result using the echo command.

Once you execute the script you will get to see the following result.

$ bash domaincheck.sh

Which of the following commands can be used to find out when a domain name expires

Conclusion

The Unix epoch time is the number of seconds from 00:00:00 UTC on 1 January 1970 to till now. Different command-line tools can be found to check the domain info on the domain but in this article, the whois command is used to display domain info. You can now also modify and improve the script according to your need if you have good knowledge of scripting.

How can I find out when a domain name expires?

How do you check the expiry date of a domain name? Checking the expiration date of a domain name is an easy process, by using the whatsmydns.net domain name expiry checker tool you can quickly and easily see the expiry date of a domain.

What is the use of nslookup command in Linux?

The nslookup command queries internet domain name servers in two modes. Interactive mode allows you to query name servers for information about various hosts and domains, or to print a list of the hosts in a domain. In noninteractive mode, the names and requested information are printed for a specified host or domain.

What if my domain expires?

What happens when my domain registration expires? You no longer own the domain, making it possible for someone else to purchase it. You might not be able to receive emails if your domain's MX records are reset by the host or a new owner.

What happens when domain expires Godaddy?

Domain goes to a final closeout auction. Until there's an active bid, you can still manually renew for the standard price plus the applicable redemption fee. Once there's a bid, you can't renew the domain, but you can place your own bid.