exam questions

Exam PT0-002 All Questions

View all questions & answers for the PT0-002 exam

Exam PT0-002 topic 1 question 181 discussion

Actual exam question from CompTIA's PT0-002
Question #: 181
Topic #: 1
[All PT0-002 Questions]

Given the following script:



Which of the following BEST characterizes the function performed by lines 5 and 6?

  • A. Retrieves the start-of-authority information for the zone on DNS server 10.10.10.10
  • B. Performs a single DNS query for www.comptia.org and prints the raw data output
  • C. Loops through variable b to count the results returned for the DNS query and prints that count to screen
  • D. Prints each DNS query result already stored in variable b
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
RRabbit_111
Highly Voted 9 months ago
Selected Answer: D
Answer: D. Prints each DNS query result already stored in variable b Explanation: Line 3 of the script creates a packet and stores it in the variable 'a'. Line 4 sends the packet and stores the results in the variable 'b'. Lines 5 and 6 loop through the results stored in 'b' and print each DNS query result stored in that variable.
upvoted 5 times
...
clutterbie
Most Recent 5 days, 21 hours ago
Selected Answer: B
I am as certain as I can be (short of actually executing the code) that B is the best fit among the provided options. Here's a recap of why the other options are definitively wrong: A: The query is for www.comptia.org, not for SOA information of the zone. C: The script loops through the answer records and prints the data within them, not the count of the results. D: The script doesn't print the entire response object stored in b; it iterates through and prints a specific attribute (.rdata) of the answer records within that response. Option B, while using the slightly imprecise phrase "raw data output," correctly identifies that a single DNS query is performed for www.comptia.org, and the subsequent lines print some of the data received in the response (specifically the rdata of the answer records).
upvoted 1 times
...
[Removed]
8 months, 1 week ago
D is answer
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago