Bird
0
0

You want to automate checking the IP addresses of multiple domains using dig. Which command correctly outputs only the IPs for example.com and test.com?

hard📝 Application Q8 of 15
Linux CLI - Networking Commands
You want to automate checking the IP addresses of multiple domains using dig. Which command correctly outputs only the IPs for example.com and test.com?
Adig +short example.com test.com
Bdig example.com && dig +short test.com
Cdig -t A example.com && dig -t A test.com | grep 'IN A'
Ddig example.com test.com
Step-by-Step Solution
Solution:
  1. Step 1: Understand +short usage for IP output

    dig +short domain outputs only IP addresses for that domain.
  2. Step 2: Check how to query multiple domains

    dig accepts multiple domains in one command: dig +short example.com test.com outputs IPs for both.
  3. Step 3: Analyze options

    dig +short example.com test.com uses a single dig command with +short for multiple domains, correctly outputting only IPs. B outputs detailed info for first domain. C uses unnecessary grep and detailed output. D lacks +short and shows detailed info.
  4. Final Answer:

    dig +short example.com test.com -> Option A
  5. Quick Check:

    dig +short accepts multiple domains [OK]
Quick Trick: dig +short supports multiple domains in one command [OK]
Common Mistakes:
  • Omitting +short for multiple domains
  • Chaining commands unnecessarily
  • Using grep unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes