Skip to main content

Querying DNS Client Configuration from the Command Line

Hands-On Lab

 

Photo of Michael Christian

Michael Christian

Course Development Director in Content

Length

00:45:00

Difficulty

Beginner

In this hands-on lab, we’ll verify the network DNS configuration settings and perform several DNS queries. Knowing how to locate this information, and how to perform queries using the configured DNS host (as well as other hosts), is a useful skill.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Querying DNS Client Configuration from the Command Line

Introduction

In this hands-on lab, we’ll verify the network DNS configuration settings and perform several DNS queries. Knowing how to locate this information, and how to perform queries using the configured DNS host (as well as other hosts), is a useful skill.

The Scenario

We have been asked to troubleshoot an issue with www.linuxacademy.com. One of the developers is having trouble reaching the host from this server, and has asked us to verify connectivity.

Logging In

Use the credentials and server IP in the hands-on lab overview page to log into our lab server.

Determine the Configured DNS Host

See which host we're using with this:

cat /etc/resolv.conf

Perform a DNS Lookup of www.linuxacademy.com Using the Configured DNS Server

host www.linuxacademy.com
dig www.linuxacademy.com

Perform a DNS Lookup of www.linuxacademy.com Using Another DNS Host

dig @1.1.1.1 www.linuxacademy.com

We could also use:

host www.linuxacademy.com 1.1.1.1

Test Connectivity to www.linuxacademy.com

Try ping:

ping -c1 www.linuxacademy.com

Then curl:

curl -I www.linuxacademy.com

Conclusion

Well, this has been an interesting little journey. We've been looking at DNS client configuration, all from the command line. Congratulations on making it through.