← 返回 anthropic 的题目列表DNS Solver Implementation (Round 1)
类型:online_judge
Task: Implement a DNS Resolver / DNS Solver
Implement a DNS solver/resolver. The prompt may provide a simplified DNS data/protocol abstraction, or it may ask you to implement behavior aligned with real DNS resolution.
Build a program/module that resolves input domain names (possibly multiple queries) into the required record types (e.g., A/AAAA/CNAME) and prints results in the required format.
Possible requirements (follow the actual prompt)
Recursive or iterative resolution (starting from root servers and following delegations).
Handling CNAME chains.
Caching and TTL (optional).
Timeouts/retries and concurrent queries (optional).
I/O format defined by the prompt (e.g., read queries from stdin and write answers to stdout).
Constraints
Use the required language/standard library per the prompt.
Handle edge cases as required: NXDOMAIN, CNAME loops, timeouts, etc.
Example
Input
example.com
Output
A 93.184.216.34 (or prompt-specified format)