{"id":119,"date":"2024-01-15T00:23:08","date_gmt":"2024-01-15T00:23:08","guid":{"rendered":"https:\/\/drupalwebhosting.in\/tutorials\/?p=119"},"modified":"2024-01-15T00:49:20","modified_gmt":"2024-01-15T00:49:20","slug":"find-dns-server-ip-address-in-linux","status":"publish","type":"post","link":"https:\/\/drupalwebhosting.in\/tutorials\/find-dns-server-ip-address-in-linux\/","title":{"rendered":"How to Find DNS Server IP Address in Linux"},"content":{"rendered":"\n<p><a href=\"https:\/\/www.drupalwebhosting.in\/domain-registration\/\" data-type=\"link\" data-id=\"https:\/\/www.drupalwebhosting.in\/domain-registration\/\"><strong>DNS<\/strong>&nbsp;<\/a>(<strong>Domain Name System<\/strong>) is a fundamental facilitator of several networking technologies such as mail servers, Internet browsing, and streaming services e.g.&nbsp;<strong>Netflix<\/strong>&nbsp;and&nbsp;<strong>Spotify<\/strong>, among others.<\/p>\n\n\n\n<p>It works on a special computer called a&nbsp;DNS server&nbsp;\u2013 which keeps a database record of several public IP addresses along with their corresponding hostnames for it to resolve or translate hostnames to IP addresses upon user request.<\/p>\n\n\n\n<p>This happens so that we would not need to bother ourselves with remembering the IP addresses of the different websites we visit.<\/p>\n\n\n\n<p>The DNS (Domain Name System) server IP address in Linux can vary depending on your network configuration and settings. Your system might use DNS servers provided by your Internet Service Provider (ISP), a local DNS resolver, or public DNS servers such as those provided by Google, OpenDNS, or others.<\/p>\n\n\n\n<p>You can find the DNS server IP addresses on your Linux system using the methods mentioned in the previous response. Common DNS server IP addresses include:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.google.com\/\" data-type=\"link\" data-id=\"https:\/\/www.google.com\/\" target=\"_blank\" rel=\"noopener\">Google <\/a>DNS:<\/p>\n\n\n\n<p>IPv4: 8.8.8.8 and 8.8.4.4<br>IPv6: 2001:4860:4860::8888 and 2001:4860:4860::8844<br>OpenDNS:<\/p>\n\n\n\n<p>IPv4: 208.67.222.222 and 208.67.220.220<br>Cloudflare DNS:<\/p>\n\n\n\n<p>IPv4: 1.1.1.1 and 1.0.0.1<br>IPv6: 2606:4700:4700::1111 and 2606:4700:4700::1001<br>Your ISP&#8217;s DNS Servers:<\/p>\n\n\n\n<p>You can find the DNS server addresses in your router settings or contact your ISP.<br>Local DNS Resolver (127.0.0.1):<\/p>\n\n\n\n<p>On some systems, a local DNS resolver may be running on 127.0.0.1.<br>To determine the specific DNS server IP address on your Linux system, you can use one of the methods mentioned earlier, such as checking the \/etc\/resolv.conf file, using the systemd-resolve command, or using the nmcli command. The actual DNS server IP address can be found in the output of these commands.<\/p>\n\n\n\n<p>While there are several things we can discuss on DNS servers such as redirection and malware attack prevention, our focus today is on how to find out your very own dns server IP address.<\/p>\n\n\n\n<p>There are several ways to check for it depending on the Operating System that you\u2019re running but Linux, BSD, and Unix-like systems all share the same method so let\u2019s begin with them.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#how-to-find-my-dns-server-ip-address\">How to Find My DNS Server IP Address<\/a><\/li><li><a href=\"#how-to-find-my-website-dns-server-ip-address\">How to Find My Website DNS Server IP Address<\/a><\/li><li><a href=\"#using-nslookup\">Using nslookup:<\/a><\/li><li><a href=\"#using-dig\">Using dig:<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-find-my-dns-server-ip-address\">How to Find My DNS Server IP Address<\/h3>\n\n\n\n<p><strong>1.<\/strong>&nbsp;To find out your DNS Server IP address, use the following&nbsp;cat command&nbsp;or&nbsp;less command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/etc\/resolv.conf<\/code><\/pre>\n\n\n\n<p>or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>less \/etc\/resolv.conf<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"79\" src=\"https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/1-1024x79.png\" alt=\"\" class=\"wp-image-120\" srcset=\"https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/1-1024x79.png 1024w, https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/1-300x23.png 300w, https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/1-768x59.png 768w, https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/1.png 1242w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>2.<\/strong>&nbsp;Another way is to use the following&nbsp;grep command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep \"nameserver\" \/etc\/resolv.conf<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1261\" height=\"89\" src=\"https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/2-1024x72.png\" alt=\"\" class=\"wp-image-121\" srcset=\"https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/2-1024x72.png 1024w, https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/2-300x21.png 300w, https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/2-768x54.png 768w, https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/2.png 1261w\" sizes=\"auto, (max-width: 1261px) 100vw, 1261px\" \/><\/figure>\n\n\n\n<p><strong>3.<\/strong>&nbsp;In newer Linux distributions that use&nbsp;<strong>systemd<\/strong>, you can use the&nbsp;<strong>systemd-resolve<\/strong>&nbsp;command to check the DNS server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemd-resolve --status | grep \"DNS Servers\"<\/code><\/pre>\n\n\n\n<p><strong>4.<\/strong>&nbsp;If you\u2019re using&nbsp;<strong>NetworkManager<\/strong>, you can use the&nbsp;nmcli command&nbsp;to get the DNS server information.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-find-my-website-dns-server-ip-address\">How to Find My Website DNS Server IP Address<\/h3>\n\n\n\n<p>To find the DNS server IP address for a specific website, you can use a command-line tool called <code>nslookup<\/code> or <code>dig<\/code>. Here&#8217;s how you can do it:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"using-nslookup\">Using <code>nslookup<\/code>:<\/h3>\n\n\n\n<p><code>nslookup<\/code> is a command-line tool used for querying the Domain Name System (DNS) to obtain domain name or IP address information. <\/p>\n\n\n\n<p>It is available on most operating systems, including Windows, Linux, and macOS. The primary purpose of <code>nslookup<\/code> is to troubleshoot DNS-related issues, gather information about DNS records, and perform various DNS-related tasks.<\/p>\n\n\n\n<p>Open a command prompt or terminal and type the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nslookup drupalwebhosting.in<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"169\" src=\"https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/4-1-1024x169.png\" alt=\"\" class=\"wp-image-127\" srcset=\"https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/4-1-1024x169.png 1024w, https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/4-1-300x50.png 300w, https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/4-1-768x127.png 768w, https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/4-1.png 1374w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"using-dig\">Using dig:<\/h3>\n\n\n\n<p><code>dig<\/code> stands for &#8220;Domain Information Groper,&#8221; and it is a command-line tool used for querying DNS (Domain Name System) servers. <code>dig<\/code> is widely available on Unix-based operating systems, including Linux and macOS. It is often used as an alternative to the older <code>nslookup<\/code> tool.<\/p>\n\n\n\n<p>To find out a website DNS Server IP address, you can use the following&nbsp;dig command, which is used to query DNS information.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dig drupalwebhosting.in<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"446\" src=\"https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/3-1024x446.png\" alt=\"\" class=\"wp-image-122\" srcset=\"https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/3-1024x446.png 1024w, https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/3-300x131.png 300w, https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/3-768x334.png 768w, https:\/\/drupalwebhosting.in\/tutorials\/wp-content\/uploads\/2024\/01\/3.png 1411w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The output will provide you with a list of IP addresses for authoritative nameservers for your website (i.e., the DNS servers responsible for your domain).<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>DNS&nbsp;(Domain Name System) is a fundamental facilitator of several networking technologies such as mail servers, Internet browsing, and streaming services e.g.&nbsp;Netflix&nbsp;and&nbsp;Spotify, among others. It works on a special computer called a&nbsp;DNS server&nbsp;\u2013 which keeps a database record of several public IP addresses along with their corresponding hostnames for it to resolve or translate hostnames to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":141,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[10],"class_list":["post-119","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-dns"],"_links":{"self":[{"href":"https:\/\/drupalwebhosting.in\/tutorials\/wp-json\/wp\/v2\/posts\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/drupalwebhosting.in\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/drupalwebhosting.in\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/drupalwebhosting.in\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/drupalwebhosting.in\/tutorials\/wp-json\/wp\/v2\/comments?post=119"}],"version-history":[{"count":13,"href":"https:\/\/drupalwebhosting.in\/tutorials\/wp-json\/wp\/v2\/posts\/119\/revisions"}],"predecessor-version":[{"id":142,"href":"https:\/\/drupalwebhosting.in\/tutorials\/wp-json\/wp\/v2\/posts\/119\/revisions\/142"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/drupalwebhosting.in\/tutorials\/wp-json\/wp\/v2\/media\/141"}],"wp:attachment":[{"href":"https:\/\/drupalwebhosting.in\/tutorials\/wp-json\/wp\/v2\/media?parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/drupalwebhosting.in\/tutorials\/wp-json\/wp\/v2\/categories?post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/drupalwebhosting.in\/tutorials\/wp-json\/wp\/v2\/tags?post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}