Top 3 ways to lookup reverse DNS on Linux

The reverse Domain Name Server or "rDNS" is the process of determining the hostname associated with a given IP address. All the mentioned commands in this article are Distro independent; hence you should be able to execute on any Linux system.

Generally speaking, the forward Domain Name Server or DNS can be used to detect the associated IP address for a particular domain name. In contrast, the reverse Domain Name Server or “rDNS” is the process of determining the hostname associated with a given IP address. In other words, we can say that the reverse DNS will perform a reverse IP lookup.

Reverse DNS lookup in Linux

The reverse DNS is used in general network troubleshooting, Email Servers, avoid spammers, and so on. In this tutorial, we will show you how to perform a reverse DNS lookup using one of the following methods:

  • Using the dig command
  • Using the host command
  • Using the nslookup command

Before starting, let’s check first how to issue a forward DNS lookup using the dig command as follows:

dig www.facebook.com

As you can notice, using the above command, you will be able to get the Facebook IP address.

Get Website IP
Get Website IP

Method 1: Check the reverse DNS using the Dig command

Typically, the dig is a shortcut for domain information groper, and it can be used to return the domain name.

Syntax:

dig [server] [name] [type]

The command lets you perform any valid DNS query such as:

  • A (the IP address)
  • TXT (text annotations)
  • MX (mail exchanges)
  • NS nameservers
dig -x 157.240.195.35

Check The Reverse DNS Using The Dig Command
The Dig Command

Moreover, you can use some additional options just to display the answer section as following:

dig -x 157.240.195.35 +noall +answer

Check The Reverse DNS Using The Dig Command With Options
The Dig Command With Options

Method 2: Check the reverse DNS using the Host command

Host checks DNS, transforms domain names to IP addresses, and vice versa. If no arguments or options are given, the host will print a summary of its command-line arguments and options.

Syntax:

host [-aCdlnrsTwv] [-c class] [-N ndots] [-R number] [-t type] [-W wait]
[-m flag] [-4] [-6] {name} [server]

In this method, the host command will be used to return the domain name as follows:

host 157.240.195.35

Check The Reverse DNS Using The Host Command
Using The Host Command

Method 3: Using the Nslookup command

Finally, the last command that can be used to return the domain name is the nslookup command. It is a simple command that is used to query the domain name servers.

Syntax

nslookup [option]

Its usage is as follows:

nslookup 157.240.195.35

Check The Reverse DNS Using The Nslookup Command
Using The Nslookup Command

Conclusion

That’s all about various ways of looking up reverse DNS from your Linux system. All the mentioned commands are Distro independent; hence you should be able to execute on any Linux system. What other method do you prefer and why? Let us know in the comments below.

Hend Adel
Hi! I'm Hend Adel, a freelancer technical geek with successful experience in Database, Linux and many other IT fields. I help to build solutions to suit business needs and creating streamlined processes. I love Linux and I'm here to share my skills via FOSS Linux! Thanks for reading my article.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,536FansLike
365FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

How to install CouchPotato on Ubuntu

Downloading movies and copying them over to your home server can get frustrating, especially if you are doing it daily! What if you have an option to download videos automatically, quickly, and above all with excellent quality. CouchPotato allows you to download movies easily once they are available and released automatically.

Top 20 Rsync Examples in Linux

The Rsync (remote sync) command is a Linux/Unix utility used to synchronize and copy files and directories either locally or remotely. Most Linux geeks use Rsync to mirror, backup or migrate data across folders, across disks and networks. One notable feature with the Rsync command is that it uses the "delta transfer algorithm."

Setting up NFS Server on Ubuntu Server

We have put together a detailed step-by-step tutorial that will guide you on how to install and set up NFS Server on Ubuntu so you too can start sharing data with other client systems. It is divided into sections, the first part discussing how to set up the host server and the second part showing you how to set up the client-side. For this tutorial, we will be using Ubuntu 20.04 LTS.

Crontab in Linux Explained With Examples

Crontab is the Linux equivalent of the Window's Task Scheduler. It can help you set up a task to run automatically at a regular...

The 10 Best Linux Server Distros For Home And Businesses

By the year 2020, it is estimated that there are close to 600 Linux distributions in the market. It includes both servers and Desktop versions; therefore, if you are looking for lightweight Linux distribution for your old PC or a reliable desktop version for employees in your organization, you may be overwhelmed with the number of choices for finding one for your use.

How to list the installed Packages on Ubuntu

It is only natural to start installing more and more software on your Ubuntu PC once you start using it. Similarly, it is also natural to lose track of the different packages that you have installed on your system. Eventually, you may be overwhelmed with the number of packages in your system and with the ones you hardly used.

MUST READ

Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.
Elementary OS 5.1 Hera has received a point release with a handful of new features and bug fixes, and we will be reviewing the significant changes in this article. For those new to elementary OS, this Ubuntu-based Linux distribution uses their inhouse built Pantheon desktop environment and AppCenter.

What is FOSS, and how does it differ from Freeware

The rise of the Linux operating system, in all its various distributions, over the past few decades has catapulted the popularity of Free or Open Source Software (FOSS). Let's guide you in understanding what is FOSS, how it differs from freeware and is Linux a FOSS.

5 Things to do when your Linux system GUI freezes

All operating systems freeze at some point and, Linux distributions are no exceptions. In this post, we are going to look at five methods you can apply to your frozen system before thinking of plugging out the power cable or holding down the power button to power off the PC.

5 Best Download Managers for Linux

We often need to download large files that can go corrupt due to various reasons such as slow internet or interrupted download. Using a broken downloaded file is not something one wants. Download managers make sure that the downloaded file maintains its integrity and also presents you with the ability to pause and resume downloads, provided the server supports it. When you are downloading a massive file, it's recommended to use a download manager.

10 ways to use the Chown command with examples

Any file in a Linux system belongs to a particular owner(s) and a group. It is one of the many features that maintain security in Linux systems. For example; If a file belongs to say UserA, then UserB cannot manipulate the data depending on any additional permissions set unless the user has permission to do that.