0
0
Linux CLIscripting~10 mins

nslookup and dig for DNS in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to look up the IP address of example.com using nslookup.

Linux CLI
nslookup [1]
Drag options to blanks, or click blank then click option'
Aexample.com
Bgoogle.com
Clocalhost
D127.0.0.1
Attempts:
3 left
💡 Hint
Common Mistakes
Using an IP address instead of a domain name.
Typing the command without a domain name.
2fill in blank
medium

Complete the code to query the MX (mail) records of example.com using dig.

Linux CLI
dig [1] example.com
Drag options to blanks, or click blank then click option'
AA
BTXT
CNS
DMX
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'A' instead of 'MX' to find mail servers.
Forgetting to specify the record type.
3fill in blank
hard

Fix the error in the command to perform a reverse DNS lookup for IP 8.8.8.8 using nslookup.

Linux CLI
nslookup [1]
Drag options to blanks, or click blank then click option'
Aarpa.in-addr.8.8.8
B8.8.8.8
C8.8.8.8.in-addr.arpa
Din-addr.arpa.8.8.8.8
Attempts:
3 left
💡 Hint
Common Mistakes
Using the .in-addr.arpa format, which requires -type=PTR (e.g., nslookup -type=PTR 8.8.8.8.in-addr.arpa).
Incorrectly ordering the IP parts.
4fill in blank
hard

Fill both blanks to create a dig command that queries the NS (name server) records for example.com and shows only the answer section.

Linux CLI
dig [1] example.com +[2]
Drag options to blanks, or click blank then click option'
ANS
Bshort
Ctrace
Dall
Attempts:
3 left
💡 Hint
Common Mistakes
Using '+all' which shows too much information.
Using the wrong record type like 'A' instead of 'NS'.
5fill in blank
hard

Fill all three blanks to create a command that uses dig to query the TXT records for example.com, uses +short to simplify output, and directs the output to a file named output.txt.

Linux CLI
dig [1] example.com +[2] > [3]
Drag options to blanks, or click blank then click option'
ATXT
Bshort
Coutput.txt
DMX
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong record type like 'MX' instead of 'TXT'.
Forgetting to redirect output to a file.