How to Troubleshoot DNS with dig and nslookup ? - Knowledge base - ScalaHosting (2024)

Amongst other users, DNS helps web users connect to websites without memorizing IP addresses—unique numeric IDs assigned to computers to enable other computers to identify and communicate with them.

This article guides you on how to troubleshoot DNS with dig and nslookup.

But first, let’s clear a few things.

Why DNS Errors Occur ?

People often see the domain name system, DNS for short, as the internet’s phone book. It’s a network of servers that track domain names and matches them to the correct IP addresses.

When you visit a website with the domain name (like scalahosting.com), your browser asks the DNS server for the IP address, enabling you to connect to the website.

DNS error occurs when the browser is unable to connect to the IP address. And one of the primary causes of this error is the DNS cache’s Time to Live (TTL).

It’s the amount of time web admins set a packet (DNS information) to exist in a DNS cache before expiration—this is where device operating systems or browsers locally store DNS information to speed up future requests.

A DNS change doesn’t often propagate in real-time – the TTL determines when and how fast it does.

When you make recent changes to your DNS records, move to a new host, or change the domain name, your website visitors will continue to see the old results or run into error until the TTL expires.

Basic Troubleshooting for DNS Issues

Some DNS issues require basic troubleshooting to resolve.

Let’s quickly take a look at them :

  • Web browsers often report connectivity problems as DNS issues. So always check your routers and internet connection.
  • Switch off your router (or unplug your modem) and wait for a few minutes before switching it back or reconnecting the modem.
  • Run malware to find out if a virus is blocking internet access.
  • Ping the website with Down For Everyone Or Just Me. If the website is down just for you, then it’s a DNS problem – otherwise, it’s not necessarily a DNS problem, it might be from the host.
  • Flush your DNS cache to eliminate polluted DNS information.

Troubleshooting DNS With Command Line

If the DNS server fails to respond after basic troubleshooting, then you might want to use the command line to troubleshoot the IP address the domain currently points to.

The article makes it intuitive – let’s quickly examine how to go about it.

Troubleshooting With Dig on macOS and Linux

Dig is the primary command-line tool for troubleshooting DNS issues on macOS and Linux.

It stands for Domain Internet Groper, and it enables users to dig into DNS issues from their computer rather than using web-based tools. You could learn more about Dig by typing [man dig] in the Linux command line.

But follow these quick steps to troubleshoot DNS issues on your macOS and Linux computers :

  • Open the terminal window. Follow this navigation path to open the terminal app on macOS, Applications >> Utilities >> Terminal. If it’s a Linux device, use the terminal shortcut key CTRL + ALT + T to open the window.
  • Run this command at the command prompt to troubleshoot the DNS dig example.com

Replace example.com with the domain name you intend to test.

Dig presents DNS information as questions and answers. The ‘QUESTION SECTION’ shows the requests while the ‘ANSWER SECTION’ displays the response to the requests.

Below is an example of Dig information for the domain, example.com.

How to Troubleshoot DNS with dig and nslookup ? - Knowledge base - ScalaHosting (1)

In the QUESTION SECTION, we could see the Dig command looks up for the A record of example.com, and the ANSWER SECTION shows the domain points to IP address 93.184.216.119.

If you wish to use a specific DNS server for the query, then you’d need to include the @ option in the dig command, and here’s an example, dig @208.67.222.222 example.com

The command performs a DNS lookup for the domain, www.example.com using an OpenDNS server with the IP address 208.67.222.222.

OpenDNS is an American company that provides DNS resolution services. The company allows users to use its DNS servers for DNS lookup instead of relying on ISPs’ DNS servers or locally installed DNS servers.

Note: Dig command displays the A record of a domain by default. If you wish to look up a different DNS record, you could specify that at the end of the command-line thus, dig example.com MX

This command-line looks up the MX (mail exchanger) records of the domain, example.com.

Troubleshooting With nslookup

The nslookup program helps windows users to troubleshoot DNS issues using the command-line.

Follow these steps to get started :

  • Press the Windows key and R on your keyboard to open the Run interface.
  • Type cmd on the search bar and press the Enter key to open the DOS command window.
  • Run this command at the command prompt to troubleshoot the DNS nslookup example.com

Replace example.com with the domain name you intend to test.

Check out how the nslookup program presents its outputs. Below is the nslookup information for google.com.

How to Troubleshoot DNS with dig and nslookup ? - Knowledge base - ScalaHosting (2)

According to the nslookup information, google.com currently points to 216.58.223.206, and the DNS server used for the query is unknown, but the IP address is 10.109.7.113.

Note: you could also use the @ option in the nslookup command if you wish to use a specific DNS server for the query. nslookup also looks up the A records of a domain by default.

Use this command to look up a different DNS record:

  • set type=MX
  • example.com

Wrapping it Up

This article outlines easy steps to troubleshoot DNS issues on Windows, macOS, and Linux operating systems using the command line.

However, you could use these web-based options if you’re not comfortable with the command line:

Was this helpful?

What’s your goal today?

1. Find the right Managed VPS solution

If you’re looking for industry-leading speed, ease of use and reliability Try ScalaHosting with an unconditional money-back guarantee.

2. Make your website lighting fast

We guarantee to make your WordPress site load in less than 2 seconds on a managed VPS with ScalaHosting or give your money back. Fill out the form, and we’ll be in touch.

3. Streamline your clients’ hosting experience

If you’re a web studio or development agency hosting more than 30 websites, schedule a call with Vlad, our co-founder and CTO, and see how we can deliver unmatched value to both your business and your clients.

How to Troubleshoot DNS with dig and nslookup ? - Knowledge base - ScalaHosting (3)

Need a custom cluster or professional advice?

Book a meeting and get a free 30-minute consultation with Vlad, co-founder & CTO of Scala Hosting, who will help you select, design and build the right solution - from a single data center cluster to a multi-region & multi-datacenter high availability cluster with hundreds of servers.

Book a free consultation

4. Learn how to grow your website in 2024

An all-star team of SEO and web influencers are sharing their secret knowledge for the first time in years. Learn about the future of SEO, Web Design best practices and the secrets to getting the foundation for your website to thrive. Watch the exclusive webinar.

An Exclusive Insiders Look Behind The SEO and Web Development Curtain

Related articles

Whois Lookup Glossary
How To Change Your Primary Domain
How to Redirect Non-WWW URLs to WWW?
How Can I Enable Mod_Rewrite Module?

How to Troubleshoot DNS with dig and nslookup ? - Knowledge base - ScalaHosting (4)

Rado

Author

Working in the web hosting industry for over 13 years, Rado has inevitably got some insight into the industry. A digital marketer by education, Rado is always putting himself in the client's shoes, trying to see what's best for THEM first. A man of the fine detail, you can often find him spending 10+ minutes wondering over a missing comma or slightly skewed design.

View All Posts

How to Troubleshoot DNS with dig and nslookup ? - Knowledge base - ScalaHosting (2024)
Top Articles
An iPhone Game Helps Me Cope With My Daily Anxiety
What to Wear When You're In Front of the Camera | Entrepreneur
Cold Air Intake - High-flow, Roto-mold Tube - TOYOTA TACOMA V6-4.0
Libiyi Sawsharpener
Main Moon Ilion Menu
Cottonwood Vet Ottawa Ks
COLA Takes Effect With Sept. 30 Benefit Payment
Fusion
Stl Craiglist
Concacaf Wiki
Joe Gorga Zodiac Sign
Mikayla Campinos Videos: A Deep Dive Into The Rising Star
Prices Way Too High Crossword Clue
Sams Gas Price Fairview Heights Il
South Bend Tribune Online
The Binding of Isaac
Driving Directions To Atlanta
454 Cu In Liters
OSRS Dryness Calculator - GEGCalculators
7 Low-Carb Foods That Fill You Up - Keto Tips
Mini Handy 2024: Die besten Mini Smartphones | Purdroid.de
Foodland Weekly Ad Waxahachie Tx
Dallas Cowboys On Sirius Xm Radio
All Breed Database
All Obituaries | Gateway-Forest Lawn Funeral Home | Lake City FL funeral home and cremation Lake City FL funeral home and cremation
27 Paul Rudd Memes to Get You Through the Week
Play It Again Sports Norman Photos
Aspenx2 Newburyport
Fleet Farm Brainerd Mn Hours
Papa Johns Mear Me
Radical Red Ability Pill
208000 Yen To Usd
UAE 2023 F&B Data Insights: Restaurant Population and Traffic Data
Donald Trump Assassination Gold Coin JD Vance USA Flag President FIGHT CIA FBI • $11.73
Urban Blight Crossword Clue
The Venus Flytrap: A Complete Care Guide
Breckie Hill Fapello
Synchrony Manage Account
Build-A-Team: Putting together the best Cathedral basketball team
Streameast.xy2
Kazwire
Planet Fitness Santa Clarita Photos
My Locker Ausd
Nami Op.gg
Eat Like A King Who's On A Budget Copypasta
St Vrain Schoology
Reli Stocktwits
Craigslist Sparta Nj
Lesson 5 Homework 4.5 Answer Key
Christie Ileto Wedding
How to Do a Photoshoot in BitLife - Playbite
Códigos SWIFT/BIC para bancos de USA
Latest Posts
Article information

Author: Tuan Roob DDS

Last Updated:

Views: 6361

Rating: 4.1 / 5 (42 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Tuan Roob DDS

Birthday: 1999-11-20

Address: Suite 592 642 Pfannerstill Island, South Keila, LA 74970-3076

Phone: +9617721773649

Job: Marketing Producer

Hobby: Skydiving, Flag Football, Knitting, Running, Lego building, Hunting, Juggling

Introduction: My name is Tuan Roob DDS, I am a friendly, good, energetic, faithful, fantastic, gentle, enchanting person who loves writing and wants to share my knowledge and understanding with you.