DNS (Domain Name System) is a fundamental facilitator of several networking technologies such as mail servers, Internet browsing, and streaming services.
It works on a special computer called a DNS IP server – which keeps a database record of several public IP addresses along with their corresponding hostnames in order for it to resolve or translate hostnames to IP addresses upon user request.
This happens so that we would not need to bother ourselves with remembering the IP addresses of the different websites we visit.
There are several ways to check for it depending on the operating system you’re running, but Centos, RHEL, Ubuntu, Debian, and Fedora systems all share the same method so let’s begin with them.
Domain name system
A DNS server maps IP addresses to fully qualified domain names. These computers are called name servers. Linux uses the BIND package, which is an Open Source DNS Server. You can configure BIND as a caching or primary server. If you need more options, you can use the BIND9 package. If you don’t have administrative rights to your Linux system, you can install BIND via the yum tool.
The NS record is the primary part of a DNS zone and identifies the servers that serve copies of the domain’s zone. An NS record must point to a valid A or CNAME record. It is used to determine the authoritative name server for a domain. The SOA record, on the other hand, identifies the authoritative server. To determine which name servers are authoritative, use the dig utility to inspect the domain’s NS and glue records.
To locate the NS record, you can use the nslookup command. This command is available on the most popular operating systems. You can use it either interactively or non-interactively. To use interactive mode, simply enter the server’s host name or IP address and hit enter. The information you get will be listed. The Nslookup command is a powerful tool for troubleshooting DNS problems.
Here are some nslookup command examples:
- use nslookup command to get the A record (IP address) of the domain name
$ nslookup lgvps.com Server: 192.168.19.2 Address: 192.168.19.2#53 Non-authoritative answer: Name: lgvps.com Address: 126.96.36.199
- Query the MX Record using -query=mx to get a list of mail exchange servers for that domain
$ nslookup -query=mx lgvps.com Server: 192.168.19.2 Address: 192.168.19.2#53 Non-authoritative answer: lgvps.com mail exchanger = 10 mx2.lgvps.com. lgvps.com mail exchanger = 5 mx1.lgvps.com. Authoritative answers can be found from: mx2.lgvps.com internet address = 188.8.131.52 mx1.lgvps.com internet address = 184.108.40.206
- Query the NS Record using -query=ns to get a list of DNS servers authoritative for that domain
$ nslookup -type=ns lgvps.com Server: 192.168.19.2 Address: 192.168.19.2#53 Non-authoritative answer: lgvps.com nameserver = ns4.lgvps.com. lgvps.com nameserver = ns2.lgvps.com. lgvps.com nameserver = ns1.lgvps.com. lgvps.com nameserver = ns3.lgvps.com. Authoritative answers can be found from: ns4.lgvps.com internet address = 220.127.116.11 ns2.lgvps.com internet address = 18.104.22.168 ns1.lgvps.com internet address = 22.214.171.124 ns3.lgvps.com internet address = 126.96.36.199
- Query the SOA Record using -query=soa to get the authoritative information about the domain
$ nslookup -type=soa lgvps.com Server: 192.168.19.2 Address: 192.168.19.2#53 Non-authoritative answer: lgvps.com origin = ns1.lgvps.com mail addr = noc.lgvps.com serial = 2012071601 refresh = 300 retry = 180 expire = 604800 minimum = 14400 Authoritative answers can be found from: ns1.lgvps.com internet address = 188.8.131.52
- View available DNS records using -query=any to get all the available DNS records
$ nslookup -type=any lgvps.com Server: 192.168.19.2 Address: 192.168.19.2#53 Non-authoritative answer: Name: lgvps.com Address: 184.108.40.206 Name: lgvps.com Address: 220.127.116.11 lgvps.com nameserver = ns1.lgvps.com. lgvps.com nameserver = ns2.lgvps.com. lgvps.com origin = ns1.lgvps.com mail addr = dns-admin.lgvps.com serial = 2012071701 refresh = 7200 retry = 1800 expire = 1209600 minimum = 300 lgvps.com mail exchanger = 20 alt1.aspmx.l.lgvps.com. lgvps.com mail exchanger = 30 alt2.aspmx.l.lgvps.com. lgvps.com mail exchanger = 40 alt3.aspmx.l.lgvps.com. lgvps.com mail exchanger = 50 alt4.aspmx.l.lgvps.com. lgvps.com mail exchanger = 10 aspmx-v4v6.l.lgvps.com. lgvps.com has AAAA address 2a00:1450:4002:801::1004 Authoritative answers can be found from: ns4.lgvps.com internet address = 18.104.22.168 ns3.lgvps.com internet address = 22.214.171.124
- Reverse DNS lookup
$ nslookup 126.96.36.199 Server: 192.168.19.2 Address: 192.168.19.2#53 Non-authoritative answer: 188.8.131.52.in-addr.arpa name = origin-www2.lgvps.com.
The Importance of a PTR Record
A PTR record is one of the most important pieces of DNS infrastructure for email deliverability. Without a PTR record, email from your domain is not accepted by mail servers. Email service providers enforce a simple test to prevent this. Instead of comparing the IP address, they conduct a reverse DNS lookup simultaneously. If your email does not have a PTR record, it will likely be discarded or sent to spam folders. So, you should double-check your system and verify if ptr is properly configured!
The easiest way to find DNS Server IP address in Linux
In this section, we’ll go over how to find out your DNS Server IP address. First, we’ll look at how to open your network connection’s details page. It should have a Properties section. There you’ll see your DNS servers. You can then copy and paste the addresses into the appropriate field. Alternatively, you can use an online service to see them. But keep in mind that this process may not be suitable for all network connections. so for such reason, we need to use some Linux command, it may be complicated, but that’s not true. It’s the easiest way. So, What you’re waiting for? let’s get started and discover this way!
To find out the DNS server IP uses the following cat or less command.
$ cat /etc/resolv.conf OR $ less /etc/resolv.conf
Also, you can use the following grep command.
$ grep "nameserver" /etc/resolv.conf
Here, nameserver 184.108.40.206 is a name server IP address in what is called the dot notation – the format that applications on your workstation use for DNS routing.
how to Find My Website DNS IP Server Address?
If you are having trouble finding your website, you may be wondering how to find your DNS server IP address. This error can occur for several reasons, including an update to your browser or a DNS server power outage. Luckily, there are several methods you can try. In this article, we’ll walk you through each step to fix your problem.
To identify a DNS server’s IP address, you can use the command dig. This command returns detailed technical information about the DNS server. The output also includes the server’s name, class of query, and refresh date. You can also find the domain name and ipv4 address. After using the dig command, you can check if the DNS server is running on your system.
The dig command supports various Linux distributions. Once you have installed it, you can start querying for DNS server IP addresses. It shows four sections: version, domain name, query option, and headers. The output also shows the query and response headers.
To find out a website DNS Server IP address, you can use the following dig command.
$ dig lgvps.com
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.68.rc1.el6_10.1 <<>> lgvps.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30412 ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;lgvps.com. IN A ;; ANSWER SECTION: lgvps.com. 21 IN A 192.168.7.11 lgvps.com. 21 IN A 192.168.7.11 ;; Query time: 0 msec ;; SERVER: 192.168.7.11 #47(192.168.7.11) ;; WHEN: Mon Jul 19 09:45:42 2019 ;; MSG SIZE rcvd: 47