DEV Community

Cover image for 12.DNS Troubleshooting
Thu Kha Kyawe
Thu Kha Kyawe

Posted on

12.DNS Troubleshooting

Lab Information

The system admins team of xFusionCorp Industries has noticed intermittent issues with DNS resolution in several apps . App Server 2 in Stratos Datacenter is having some DNS resolution issues, so we want to add some additional DNS nameservers on this server.

As a temporary fix we have decided to go with Google public DNS (ipv4). Please make appropriate changes on this server.

Lab Solutions

🧭 Part 1: Lab Step-by-Step Guidelines

Objective

Fix DNS resolution on App Server 2 (stapp02) by adding Google Public DNS.

Google DNS servers:

8.8.8.8
8.8.4.4

These must be added to:

/etc/resolv.conf

1️⃣ Login to Jump Host

ssh thor@jump_host.stratos.xfusioncorp.com
Enter fullscreen mode Exit fullscreen mode

Password

mjolnir123

2️⃣ SSH into App Server 2

ssh steve@stapp02
Enter fullscreen mode Exit fullscreen mode

Password

Am3ric@

3️⃣ Switch to Root

sudo -i
Enter fullscreen mode Exit fullscreen mode

4️⃣ Edit the DNS Configuration

Open the file:

vi /etc/resolv.conf
Enter fullscreen mode Exit fullscreen mode

Add the following lines:

nameserver 8.8.8.8
nameserver 8.8.4.4
Enter fullscreen mode Exit fullscreen mode

Save:

ESC
:wq

5️⃣ Verify DNS

Test with:

ping -c 2 google.com
# If ping doesn't found, please run this
yum install -y iputils
Enter fullscreen mode Exit fullscreen mode

If DNS works, it will resolve the IP address.


🧠 Part 2: Simple Explanation (Beginner Friendly)

What DNS does

DNS converts domain names into IP addresses.

Example:

google.com → 142.250.183.238

Without DNS, the system cannot resolve domain names.

Why the server has DNS issues

The lab states:

intermittent DNS resolution issues

This means the current DNS server may be slow or unavailable.

Why we use Google DNS

Google provides reliable public DNS servers:

DNS Server Address
Primary 8.8.8.8
Secondary 8.8.4.4

These are widely used for troubleshooting.

What /etc/resolv.conf does

File:

/etc/resolv.conf

This file tells Linux which DNS servers to query.

Example:

nameserver 8.8.8.8

means:

Ask Google DNS for domain lookups

Resources & Next Steps
📦 Full Code Repository: KodeKloud Learning Labs
📖 More Deep Dives: Whispering Cloud Insights - Read other technical articles
💬 Join Discussion: DEV Community - Share your thoughts and questions
💼 Let's Connect: LinkedIn - I'd love to connect with you

Credits
• All labs are from: KodeKloud
• I sincerely appreciate your provision of these valuable resources.

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.