{"uid":"cap_8wqgOPP9RWiTaM2IuHmzf","slug":"2s-dns-lookup-api-abb1f933","name":"2s DNS Lookup API","description":"Resolve a hostname over public DNS and return parsed records. Query: host (required FQDN), types (comma-separated: A,AAAA,MX,TXT,NS,CAA,SRV,CNAME,PTR,SOA — default A,AAAA,MX,TXT,NS), resolver (cloudflare|google|quad9|opendns, optional). Returns one normalized JSON shape per record type with per-type error pass-through. Reserved/local TLDs (.local, .internal, .invalid, .test, localhost) are rejected. 4s per-query timeout.","url":"https://2s.io/api/dns/lookup","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","queryParams"],"properties":{"type":{"const":"http"},"method":{"const":"GET"},"queryParams":{"type":"object","required":["host"],"properties":{"host":{"type":"string","maxLength":253,"minLength":1},"types":{"type":"string"},"resolver":{"enum":["cloudflare","google","quad9","opendns"],"type":"string"}},"additionalProperties":false}}}}},"responseSchema":null,"example":{"request":{"input":{"type":"http","method":"GET","queryParams":{"host":"example.com","types":"A,MX","resolver":"cloudflare"}}},"response":{"data":{"ok":true,"items":[{"query":"example.com","answers":[{"type":"A","records":[{"ttl":138,"address":"104.20.23.154"},{"ttl":138,"address":"172.66.147.243"}]},{"type":"MX","records":[{"type":"MX","exchange":"","priority":0}]}],"resolver":"1.1.1.1","durationMs":2}],"total":1,"source":{"url":"https://2s.io","license":"Public DNS data","provider":"Public DNS resolvers"}},"meta":{"cost":{"usd":0.001,"tier":0},"caller":"x402","version":null,"endpoint":"dns.lookup","settlement":{"txHash":"0xe8beea18b9677bd3d75246de1b09fe27f98394ff59ea6dd34e0f1a7e8c544dbe","network":"eip155:8453","success":true}}}},"exampleRequest":{"host":"example.com","types":"A,MX","resolver":"cloudflare"},"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0025","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0025","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OsRXt3Y1o1g5Gm_dHRnYS","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0025","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Performs DNS record lookups for a given hostname, returning structured results including A, AAAA, MX, TXT, NS, CAA, SRV, CNAME, PTR, and SOA records via a pay-per-call REST API.","exampleAgentPrompt":"What are the MX and TXT records for github.com? Use Cloudflare as the resolver.","exampleUseCases":null,"resultDescription":"Returns a JSON object with an array of DNS record items matching the query, a total count, and source metadata including the resolver provider, URL, and license. Each item contains record-type-specific fields such as IP addresses, priority, and values.","failureModes":["Invalid or non-existent hostname returns empty items array or error","Unsupported record type pattern returns validation error","Requested resolver is unavailable causing timeout or error","Payment not completed results in 402 response before data is returned","Rate limits or resolver outages may cause transient failures"],"whenToPreferThis":"Use this endpoint when an AI agent needs programmatic, structured DNS resolution without maintaining API keys or subscriptions — ideal for one-off or infrequent DNS lookups billed per call in USDC. Prefer this over self-hosted DNS libraries when you need flexibility to switch resolvers (Cloudflare, Google, Quad9, OpenDNS) and want normalized JSON output.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T06:50:02.576Z","isFirstParty":false}