Sign In
Sign In

How to Fix "Server IP Address Could Not Be Found"

How to Fix "Server IP Address Could Not Be Found"
Awais Khan
Technical writer
DNS
05.03.2025
Reading time: 6 min

The "Server IP Address Could Not Be Found" error arises from DNS resolution problems, which hinder the system from converting domain names into their related IP addresses. Several factors produce this error: DNS configuration errors, server uptime instability, or server hardware problems. The identification of primary causes stands as the key to solving issues successfully.

If facing such an error, move to this blog to find out different solutions to identify and repair the issue. 

Solution 1: Stable Internet Connectivity

To start server access you must have a dependable internet connection. Utilize the procedure outlined below to ensure your connection stays stable.

  • Verify physical connectivity by inspecting cables and validating the chosen Wi-Fi network. Cables that become loose will produce connection issues.

  • Reboot your router or modem to address potential connectivity problems: power them down, wait ten seconds, then turn them back on. A stable connection can be restored by running this procedure which removes temporary connection glitches.

  • Evaluate the host using various devices like tablets, computers, or smartphones, to check if device compatibility is contributing to the issue.

  • Engage your ISP if you suspect they can assist in alleviating your connectivity woes.

Solution 2: Verify and Adjust DNS Settings

Network access can be disrupted by improperly configured DNS settings. Checking and tweaking your DNS settings can aid in identifying network issues and sustaining a consistent internet connection. To review and modify your DNS settings, adhere to these guidelines.

Use Default DNS Settings

Leveraging the default DNS configuration provides hassle-free and consistent network connectivity without extra configuration efforts. Here’s way to do it:

Windows

  • Access Control Panel via the Start Menu.

Image1

  • Select Network and Internet, then visit Network and Sharing Center.

Image3

  • Click Change adapter settings.

Image2

  • Right-click on the in-use network and delve into Properties.

Image5

  • Activate IPv4 and head to Properties.

Image4

  • Enable automatic DNS server address obtaining in the settings.

Image7

macOS

  • Enter System Preferences and explore the Network option.
  • Opt for an in-use network (Ethernet or Wi-Fi).
  • Opt for Advanced to open the DNS tab.
  • Verify DNS servers have an automatic configuration.

Utilize Public DNS Servers

The domain resolution services delivered by Google and Cloudflare maintain reliability together with high speed. Consider using these public DNS addresses: 

Google

  • Primary Address: 8.8.8.8

  • Secondary Address: 8.8.4.4

Cloudflare

  • Primary Address: 1.1.1.1

  • Secondary Address: 1.0.0.1

Flush DNS Cache

Connectivity problems can stem from faulty or outdated DNS records on someone’s system. Here’s the procedure to refresh the DNS cache:

Windows

  • Open Command Prompt with admin rights and execute: 

ipconfig /flushdns

Image6

macOS

  • Open Terminal and execute:

sudo killall -HUP mDNSResponder

Solution 3: Analyze the Host File

To fine-tune domain name lookups, the host file can be utilized to alter DNS settings, providing control over the domain-to-IP mapping. You can check and perform modification in the host file via following procedure:

Modify the Hosts File

  • Use Notepad for hosts files edits on Windows systems but users must select between Nano or Vi text editors for macOS/Linux platforms.
  • Each line of the file needs careful inspection to find any errors or incorrect access causing the issue.
  • After editing, save the changes and close the editor.

Reload DNS Service

Refreshing the DNS client service can alleviate DNS-related problems.

Windows

  • Launch Services Manager via Win + R, and enter services.msc.

Image9

  • Find DNS Client by scrolling down in the manager tab.

Image8

  • Right-click the Client and trigger a Restart.

macOS

  • Fire up the Terminal and apply:

sudo killall -HUP mDNSResponder

The command reinitializes mDNSResponder service, enabling the new DNS configuration updates to be implemented.

Solution 4: Examine Server Configuration

When issues persist, server configuration issues might be the culprit. To verify and correct server setup follow this procedure:

  • Check all DNS records of your domain for proper configuration. Digital DNS tools and Network Services Lookup tools can be used to verify that DNS records function correctly.

  • The server firewall requirements must include DNS traffic authorization. Modify firewall settings to enable DNS query transmission if needed.

  • Performing a server restart of DNS services will rectify any configuration issues, resulting in improved connectivity. Run below command to restart the named service on a Linux server.

sudo systemctl restart named

Solution 5: Update Network Drivers

The IP address error can frequently be attributed to network drivers that are either obsolete or corrupted. A possible fix for such an issue is to simply update the network drivers.

Windows

  • Hit Win + X and launch Device Manager through the list.

  • Open the Network Adapters options using dropdown arrow.

Image12

  • Right-click the driver, move to Update driver, then pick Search automatically for drivers. Follow the steps to finalize the update.

Image10

macOS

  • Launch System Preferences, move to Software Update, and confirm if there are any updates.
  • Kick off the installation by clicking Update Now.

Solution 6: Clear Browser Cache

The browser cache can hinder DNS resolution, generating issues. Wiping the browser cache may help fix your error.

Google Chrome

  • After launching Chrome, click on the three vertical dots in the upper-right corner.
  • Access Settings, find Privacy and Security, and opt for Clear browsing data.
  • Go with All Time, mark the option Cached images and files, and select Clear now.

Image11

Solution 7: Use Troubleshooter

Most distributions are equipped with network troubleshooters that help you detect and fix connectivity issues. Here's how to use it:

Windows

  • Open the Settings by hitting Win + I.

Image13

  • From Update & Security, pick Troubleshoot → Additional troubleshooters.

Image14

  • Move to Internet Connections:

Image15

  • Launch the troubleshooter:

Image16

macOS

  • Access System Preferences and move over to Network.
  • Pick the Help Me options and select Diagnostics.
  • Follow the on-screen prompts to run the network diagnostics.

Solution 8: Check for Malware

Viruses or malware may hinder DNS resolution, triggering connectivity problems. Conducting a malware scan could help detect and remove any harmful software. Here's how to run a malware scan:

Windows

  • Open Settings to locate Update & Security followed by Windows Security to access Windows Defender.

Image17

  • Check for viruses with Virus & Threat Protection and then select between Quick Scan and Full Scan as detection methods.

Image18

macOS

  • Leverage dependable antivirus software to scan for potential malware and viruses.
  • Adhere to the software's instructions to carry out a full system scan and eliminate any detected threats.

Conclusion

By following the instructions in this article, you'll be able to pinpoint and fix the "Server IP Address Could Not Be Found" error. Essential actions include DNS setup verification, host file check for inconsistencies, restarting critical services, upgrading network drivers, clearing cached data in a browser, and utilizing built-in network troubleshooting tools. Each of these actions addresses particular connectivity issue reasons, ensuring a comprehensive method for maintaining smooth network access. Keeping your server's IP address readily discoverable is important for uninterrupted connectivity and reliable access to your services.

DNS
05.03.2025
Reading time: 6 min

Similar

DNS

DNS Configuration for IPv6: Step-by-Step Tutorial

The internet is gradually transitioning to IPv6, and an increasing number of websites, applications, and devices are adopting it. But having an IPv6 address alone isn’t enough. To make everything work properly, you need to configure DNS correctly—both on the server side and on your own computer. Without DNS, no connection will work: the browser simply won’t know where to send the request. This is especially critical for IPv6. If you forget to set the necessary DNS records, your site will become invisible to many users, and even content that used to open just fine may stop working on client devices. How to Check if Your ISP Supports IPv6 This guide is relevant only if your internet provider supports IPv6. Linux-based OS Run the following command: ip -6 addr show If you see interface addresses starting with 2xxx: or 3xxx:, then your provider supports IPv6. macOS Use the command: ifconfig If your ISP assigns an IPv6 address, it will look something like this: Windows Open Command Prompt by pressing Win + R, then type cmd. Enter the following command: ipconfig You should see output like this: What Is DNS for IPv6, and Why Is It Important? DNS is like the internet’s address book. When a user types a website address, the browser doesn’t know where to go—it needs an IP address. DNS translates human-readable addresses into a numeric IP address that devices and networks can use. You need to configure DNS for IPv6 in two places: 1. On the Server (where your website or service is hosted) This enables browsers to find your site via IPv6. If your domain’s DNS zone doesn’t contain an AAAA record with the server’s IPv6 address, browsers won’t even know that they can use the new protocol to access your site. As a result, the site may load slowly or not at all for users with IPv6-only access. 2. On the Client Side (your computer or router) Your computer also needs to know which DNS server to use in order to resolve site addresses into IPv6 format. If your computer or router doesn’t have access to a DNS server that supports IPv6, it won’t open the site, even if your ISP supports IPv6. You need to set up DNS for IPv6 so that the internet continues working quickly, reliably, and without interruptions under the new protocol. Without proper configuration, IPv6 might be available—but not functional. The Best Public IPv6 DNS Servers To ensure stable and fast performance, your device must know which DNS server to query. Usually, the router handles this: it receives the settings from your ISP and distributes them to the network. But if your ISP doesn’t support IPv6 or their DNS is unstable, you can manually specify public DNS servers that support IPv6. These are free, reliable addresses accessible from anywhere in the world: Name Primary IPv6 DNS Address Secondary IPv6 DNS Address Google DNS 2001:4860:4860::8888 2001:4860:4860::8844 Cloudflare 2606:4700:4700::1111 2606:4700:4700::1001 Quad9 2620:fe::fe 2620:fe::9 OpenDNS 2620:119:35::35 2620:119:53::53 All of these services: support IPv6 without additional setup, respond quickly to queries worldwide, protect against fake and malicious sites (especially Quad9 and OpenDNS). When Should You Set DNS Manually? Follow the instructions below if any of the following apply: Your device does not automatically receive DNS server settings. Your ISP does not support IPv6 at the DNS level. Websites load slowly or return “address not found” errors. The next sections explain how to manually configure DNS servers. It only takes a few minutes and results in a stable, error-free internet connection. Configuring DNS IPv6 on Windows If you have internet access but websites won’t load, Windows might not know which DNS server to use for IPv6. You can fix this easily by setting the correct addresses manually. This method works for both Windows 10 and 11—the interface is nearly identical. Open Network Connections: Press Win + R, type ncpa.cpl, and hit Enter. A window with all connections (Ethernet, Wi-Fi, etc.) will open. Find your active connection. It’s usually called “Local Area Connection” or “Wireless Network”.  Right-click on it → select Properties. Choose Internet Protocol Version 6 (TCP/IPv6). In the list of components, find this line and click the Properties button. Enter the DNS servers manually: Check Use the following DNS server addresses. Type in: Preferred: 2001:4860:4860::8888 Alternate: 2001:4860:4860::8844 Save your settings. Click OK → OK, then close the window. Windows will now use the specified DNS servers for IPv6 connections. Configuring IPv6 DNS in Linux DNS configuration in Linux depends on the edition you're using (desktop or server) and the network management tool used (NetworkManager, systemd-networkd, or manual configuration). To ensure everything works correctly with IPv6, you need to determine who is responsible for the network and DNS in your system and then choose the appropriate configuration method. How to Find Out What Your Distribution Uses Open a terminal and run: nmcli device If the command returns a list of interfaces and their statuses, you’re using NetworkManager. If nmcli is not installed, try: networkctl If you see interfaces with the status routable, configured,  you're using systemd-networkd. Ubuntu Desktop, Fedora, Manjaro — Using NetworkManager If you use a graphical environment (GNOME, KDE, Xfce) and see a network icon in the panel — most likely you're using NetworkManager. Via GUI: Go to Settings → Network → Select active connection → IPv6 In the DNS section: Switch the mode to “Manual” or “Advanced” Enter DNS addresses, e.g.: 2001:4860:4860::8888 and 2001:4860:4860::8844 Save and restart the connection Via terminal: nmcli connection modify eth0 ipv6.dns "2001:4860:4860::8888 2001:4860:4860::8844" nmcli connection modify eth0 ipv6.ignore-auto-dns yes nmcli connection up eth0 Replace eth0 with your actual interface name (check it by running nmcli device). Ubuntu Server (18.04+, 20.04+, 22.04+) — Using Netplan On Ubuntu server editions, netplan is used to generate configuration for systemd-networkd. Open the configuration file, for example: sudo nano /etc/netplan/01-netcfg.yaml Add IPv6 addresses in the nameservers section. Be sure to strictly follow YAML formatting — use spaces only, no tabs. Usually, indentations are multiples of 4 spaces. In the addresses field, insert the IPv6 address with /64. In the gateway6 field, insert the gateway — drop the last group of your IPv6 address and replace it with 1 to get the gateway address.  network: version: 2 ethernets: eth0: dhcp4: true dhcp4-overrides: use-dns: false dhcp6: false addresses: - 2001:0db8:a::0370/64 gateway6: 2001:0db8:a::1       match: macaddress: <insert your machine’s MAC address> nameservers: addresses: - 2001:4860:4860::8888 - 2001:4860:4860::8844 Apply the changes: sudo netplan apply After applying the changes, verify that the correct DNS servers are in use. If the DNS Servers field displays incorrect servers, they are likely being automatically delivered via DHCP. Disable this as follows: Ensure correct permissions on the YAML file: sudo chmod 600 /etc/netplan/01-netcfg.yaml Delete the old resolv.conf and create a symlink: sudo rm -f /etc/resolv.conf sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf If you get the error “Unable to resolve host”, add the hostname to /etc/hosts: HOSTNAME=$(hostname) sudo sed -i "/127.0.1.1/d" /etc/hosts echo "127.0.1.1 $HOSTNAME" | sudo tee -a /etc/hosts Enable systemd-resolved (if it’s not already): sudo systemctl enable systemd-resolved --now Apply configuration and restart services: sudo netplan apply sudo systemctl restart systemd-networkd sudo systemctl restart systemd-resolved Recheck the result: resolvectl status resolvectl dns At this point, DHCP-based DNS should be fully disabled. Modern Systems with systemd-resolved If your system uses systemd-resolved directly (e.g., Arch Linux, or Ubuntu with systemd), you can define DNS via the config file. Open the configuration file: sudo nano /etc/systemd/resolved.conf Add the following lines: [Resolve] DNS=2001:4860:4860::8888 2001:4860:4860::8844 FallbackDNS=2606:4700:4700::1111 Restart the service: sudo systemctl restart systemd-resolved Manual Configuration via resolv.conf — If Nothing Else Works Sometimes, it's easiest to make changes directly in /etc/resolv.conf, especially in minimal systems or containers. Open the file: sudo nano /etc/resolv.conf Add the lines: nameserver 2001:4860:4860::8888 nameserver 2001:4860:4860::8844 Keep in mind that the system often overwrites this file. To preserve settings: sudo chattr +i /etc/resolv.conf Configuring IPv6 DNS on a Router If you've already configured IPv6 DNS on your server and PC, but the site still won't open via the new protocol, check your router settings. The router distributes the internet and tells devices where to send DNS queries. If no IPv6-enabled DNS servers are set on the router, your home devices may still use the old protocol — even if the ISP has switched to IPv6. Where to Find IPv6 DNS Settings It depends on the model, but the typical path is: Router settings → Internet / WAN → IPv6 → DNS. If there is a separate DNS tab, go to it. Some models hide these parameters in Advanced sections. Example: TP-Link Router Go to the router’s interface: 192.168.0.1 or tplinkwifi.net Enter your login and password Go to Advanced → IPv6 Enable IPv6 — it’s usually off by default In WAN connection settings, check Configure the DNS server manually Enter your selected IPv6 DNS addresses, e.g.: 2001:4860:4860::8888 2001:4860:4860::8844 Save changes and reboot the router Example: Keenetic Router Go to my.keenetic.net From the menu, select Internet → Connection Go to the DNS Servers tab Check Manual Enter IPv6 addresses (e.g., Google DNS) Apply changes and reboot the router What to Do If DNS Doesn’t Accept IPv6 Check whether your router supports IPv6 (not all older models do). Make sure your ISP has assigned a global IPv6 address (and not just fe80::). Try updating your router’s firmware — this often resolves the issue. How to Test DNS over IPv6 Testing DNS over IPv6 is easy — both in a browser and via the terminal. It takes just a few minutes and quickly helps identify where the problem is: in the DNS, the network, or IPv6 itself. In the Browser The simplest method is to open a testing site: test-ipv6.com The page will show: Whether there is an IPv6 connection. Which protocol is used by default (IPv4 or IPv6). Whether DNS over IPv6 is working. Whether popular websites have AAAA records. If everything is green, it’s working fine. If there’s an error, the site will tell you what the issue is. In the Terminal (Linux, macOS) Check the AAAA DNS record: dig AAAA google.com If the response includes an IPv6 address (e.g., 2a00:1450:4009::200e), then DNS over IPv6 is working. Check which DNS servers are being used: resolvectl status This shows active interfaces and DNS servers (including IPv6 ones). Check whether traffic goes through IPv6: ping6 google.com Or: curl -6 https://ifconfig.co If the command executes and shows an IPv6 address, then IPv6 connectivity is active. Solving Common Issues Below is a cheat sheet for resolving problems frequently encountered when configuring IPv6 DNS: Symptom Problem Solution Websites open, but slowly. ping6 works, but ping is faster. The browser tries IPv6 first, then falls back to IPv4. The DNS server responds too slowly. Often, the ISP's default DNS is the culprit. Switch to a fast public DNS server. See "Configuring IPv6 DNS in Windows" or "Configuring IPv6 DNS in Linux". ping6 google.com → “Name or service not known” The DNS client is not receiving IPv6 responses: either the server addresses are incorrect or IPv6 is disabled on the interface. Check if IPv6 is active using ip -6 addr. Make sure resolvectl status shows an IPv6 DNS server. If not, set one manually (see Windows or Linux setup guides). Internet stops working after netplan apply. There’s a syntax error in the YAML file or the gateway is missing. Check the file using netplan try. If there’s an error, roll back and reapply the changes carefully. Watch for typos and fix indentation — use two spaces per level. No active connections in Ubuntu GUI. Netplan uses systemd-networkd, while the GUI expects NetworkManager. Either edit Netplan for a server setup, or install NetworkManager and change renderer: NetworkManager in the config file. nslookup -type=AAAA site.com in Windows shows “Non-existent domain”. The router does not have IPv6 DNS set, or its firmware does not support the protocol. Log in to the router's admin panel → “IPv6” → “DNS” → enter Cloudflare or Google DNS. Update firmware if the “IPv6” section is completely missing. Docker container ignores IPv6 DNS. Docker daemon uses its own resolv.conf copied at startup. Add the DNS address to /etc/docker/daemon.json, or pass it when launching the container: docker run --dns 2606:4700:4700::1111 alpine systemd-resolved continuously caches a SERVFAIL error. An upstream DNS server failed; the failed response is cached. Clear the cache and change DNS: sudo resolvectl flush-caches sudo systemd-resolve --set-dns=2001:4860:4860::8888 --interface=eth0 A site with HSTS loads via HTTPS only over IPv4. The certificate has only an A record; there's no AAAA record — the browser doesn’t trust it. Issue a certificate that validates both IP versions. For Let’s Encrypt:   sudo certbot --preferred-challenges http -d site.com -d '*.site.com' ping6 to a local host is OK, but gives “Network unreachable” to the internet. The ISP assigned a prefix but no gateway (gateway6 is not set). Manually add a gateway: gateway6: 2a03:6f01:1:2::1 Apply the changes: sudo netplan apply IPv6 address is present, but DNS queries go to 192.168.0.1.  The router distributes IPv4 DNS via DHCPv6 Option 23; the system gives them higher priority. Manually set IPv6 DNS with the highest priority: sudo resolvectl dns-priority eth0 0 dig @2606:4700:4700::1111 google.com works, but dig google.com doesn't. systemd-resolved listens on 127.0.0.53, but a local firewall blocks outbound DNS packets. Allow outbound traffic on port 53 (UDP and TCP) or disable UFW: sudo ufw allow out 53 Compare your symptom with the first column and check the brief diagnosis in the second column. Execute the command(s) in the third column and verify the result. If the issue isn’t resolved, return to the DNS setup steps. Conclusion The transition to IPv6 is slow, but inevitable. More and more ISPs are issuing only IPv6 addresses, more hosting providers are operating with Dual Stack, and more services are checking for IPv6 support by default. And if DNS is misconfigured, connections fail, websites won’t load, and users will leave for services that work. The good news? It all takes 5–10 minutes: Add an AAAA record in your hosting panel; Set reliable public DNS servers on your server, router, and client devices; Check the result — and forget about the issue. IPv6 is not about the future — it’s about ensuring your website, service, or home network works reliably right now. And a properly configured DNS is your ticket into this new Internet.
17 June 2025 · 13 min to read
Linux

Setting Up a DNS Server

A personal DNS server can be useful if your provider doesn't offer this service or if existing solutions don't suit your needs. The easiest way to set one up is via a control panel (cPanel, CloudPanel, HestiaCP, etc), but you can also do it manually using the terminal and the Linux DNS Server BIND 9. Preparing the Server Let's say you've rented a Hostman Linux VPS and want to use your own DNS servers. To do that, you need to meet two conditions: Order another public IP address — DNS setup requires at least two IPs. Open DNS port 53, which is necessary for the nameserver to work. Ubuntu/Debian Update the package list: apt update Allow incoming packets on port 53 UDP in the firewall: iptables -I INPUT -p udp --dport 53 -j ACCEPT Save the firewall rules: iptables-save CentOS Install system updates: yum update Install time synchronization utility: yum install chrony Set your timezone, for example: timedatectl set-timezone Europe/Cyprus Enable and start the time synchronization service: systemctl enable chronyd --now Open port 53: firewall-cmd --permanent --add-port=53/udp Apply the updated firewall rules: firewall-cmd --reload Installing the DNS Server This guide uses BIND 9 to create an IP-based DNS server. Ubuntu/Debian Install required packages: apt-get install bind9 dnsutils Enable autostart: systemctl enable bind9 Start the service: systemctl start bind9 Check if it's running: systemctl status bind9 Look for active status in the output. CentOS Install the DNS utility: yum install bind Enable autostart: systemctl enable named Start the service: systemctl start named Check its status: systemctl status named You should see active in the output. Basic DNS Server Configuration The settings are defined in the configuration file. Ubuntu/Debian Open the config file: vi /etc/bind/named.conf.options In the listen-on block, specify the networks, e.g.: listen-on { 10.10.10.0/24; 10.1.0.0/16; }; To allow the DNS server to listen on all interfaces, either omit this line or use any. In the allow-query line, specify who can make queries: allow-query { any; }; Restart the service for changes to take effect: systemctl restart bind9 CentOS Open the config file: vi /etc/named.conf Find these lines: listen-on port 53 { 127.0.0.1; localhost; 192.172.160.14; }; ... allow-query { any; }; In the listen-on line, after localhost, specify the DNS IP address. This is the IP on which the host will accept queries. Use any to listen on all addresses. In the allow-query line, define query permissions. any allows queries from everyone. You can also restrict it to a specific subnet, e.g., 192.172.160.0/24. Apply the config: systemctl restart named Global Options Besides the basics, you can fine-tune the server using other global parameters: Argument What It Configures directory Working directory (default is /var/named if not specified) forwarders IPs to forward unresolved queries to (e.g., Google's DNS) forwarders { 8.8.8.8; 8.8.4.4; }; forward Options: FIRST or ONLY. FIRST tries forwarders first, then internal. ONLY skips internal search. listen-on Interfaces that BIND listens on (usually port 53 UDP) allow-transfer Hosts allowed for zone transfers allow-query Who is allowed to send DNS queries allow-notify Hosts allowed to receive zone change notifications allow-recursion Hosts that can make recursive queries. Default is unrestricted. Testing To check if the DNS server accepts queries from clients, use the nslookup utility. From another computer: nslookup site-example.com 192.172.160.14 This checks the IP address of site-example.com using DNS server 192.172.160.14. Alternatively, use dig: dig @192.172.160.14 site-example.com It works similarly, just a different syntax. BIND Zones Basic DNS server setup is complete. Now, let’s talk about usage. For that, you configure zones: Primary zone – You create and edit domain records directly on this host. Secondary zone – This host pulls data from a primary DNS server. Stub zone – Stores only NS records used for redirection. Caching-only zone – Doesn’t store records; only caches query results for performance. Zone management is handled in the config file and is a larger topic. Creating your own zone lets you assign friendly names to each host, which is helpful when dealing with many nodes instead of using IPs.
10 April 2025 · 4 min to read
Network

A Complete Guide to the nslookup Command in Linux and Windows

The nslookup command is a widely used tool for querying Domain Name System (DNS) records. It helps network administrators troubleshoot DNS-related issues by allowing them to perform a range of lookups, from finding IP addresses associated with domain names to querying specific DNS servers. This tutorial will guide you through the basics of using nslookup on both Linux and Windows platforms. In this tutorial, you will learn: Basic syntax and options of nslookup How to perform simple DNS queries Retrieving mail exchange (MX) records Performing reverse DNS lookups Querying specific DNS servers Using non-interactive mode By the end of this tutorial, you will be familiar with the most common and useful nslookup commands for effective DNS troubleshooting. Basic Syntax and Options for nslookup The basic syntax for the nslookup command is straightforward: nslookup [options] [domain] Here is a breakdown of the commonly used options: No parameters: Opens an interactive mode where you can enter multiple queries [domain]: Performs a DNS lookup for the specified domain name -type=[record_type]: Specify the type of DNS record to query (e.g., A, MX, AAAA, etc.) [server]: Specify a DNS server for querying instead of using the default system server For example: nslookup example.com This command performs a DNS lookup for "example.com" using your default DNS server. Common Options for nslookup -query=A: Query the IP address (default record type) -query=MX: Retrieve mail exchange records -query=AAAA: Query for IPv6 addresses -timeout=[seconds]: Set a timeout for the response -debug: Show detailed information about the query process How to Perform a Simple DNS Query One of the most common uses of nslookup is to resolve domain names to IP addresses. Step-by-Step Guide to Performing a Simple DNS Query Open the terminal or command prompt. Type the nslookup command followed by the domain name: nslookup google.com Output: In this example, the DNS server at 8.8.8.8 (Google's public DNS server) returned the IP address 142.250.65.238 for google.com. Using nslookup to Retrieve MX Records The mail exchange (MX) records for a domain indicate which mail servers are responsible for receiving emails on behalf of that domain. To retrieve the MX records using nslookup: Use the -type=MX option to specify that you want to retrieve MX records.     nslookup -query=MX gmail.com The output will list the MX records, including the mail servers and their priority: Server: 8.8.8.8 Address: 8.8.8.8#53 Non-authoritative answer: gmail.com mail exchanger = 20 alt2.gmail-smtp-in.l.google.com.. gmail.com mail exchanger = 10 alt1.gmail-smtp-in.l.google.com. In this case, the mail servers for gmail.com are listed along with their priorities. The lower the number, the higher the priority. Performing Reverse DNS Lookups A reverse DNS lookup translates an IP address back to its associated domain name. This is useful for identifying the domain that corresponds to a given IP address. To perform a reverse DNS lookup, input the IP address into the nslookup command: nslookup 142.250.65.238 The output should display the domain name associated with the IP: Non-authoritative answer: 238.65.250.142.in-addr.arpa name = lga25s73-in-f14.1e100.net. In this example, the IP 142.250.65.238 resolves back to lga25s73-in-f14.1e100.net, which is part of Google's infrastructure. Querying Specific DNS Servers By default, `nslookup` uses the system's configured DNS server to perform queries. However, you can specify a different DNS server if needed. To query a specific DNS server, append the server's IP address to the command: nslookup example.com 1.1.1.1 The command will query the 1.1.1.1 DNS server (Cloudflare's DNS) for the domain example.com: Server: 1.1.1.1 Address: 1.1.1.1#53 Non-authoritative answer: Name: example.com Address: 93.184.215.14 This allows you to test DNS resolution from different servers. Using Non-Interactive Mode in nslookup In non-interactive mode, you can issue multiple queries without entering nslookup's interactive shell. This is useful when scripting or automating tasks. To use nslookup non-interactively, simply pass the domain name and the server (optional) in one command: nslookup example.com 8.8.8.8 The response will be printed directly, without entering the interactive shell: Server: 8.8.8.8 Address: 8.8.8.8#53 Non-authoritative answer: Name: example.com Address: 93.184.215.14 This method is efficient when you need to quickly query DNS records without additional input. Conclusion The nslookup command is a powerful and flexible tool for performing DNS queries. Whether you're troubleshooting domain resolution, retrieving MX records, or performing reverse lookups, nslookup is an essential command for network administrators. By mastering the options and syntax, you can use nslookup effectively on both Linux and Windows systems. To recap, here’s what we covered in this tutorial: Performing simple DNS queries Retrieving MX records Conducting reverse DNS lookups Querying specific DNS servers Using non-interactive mode
18 October 2024 · 4 min to read

Do you have questions,
comments, or concerns?

Our professionals are available to assist you at any moment,
whether you need help or are just unsure of where to start.
Email us
Hostman's Support