{"id":51126552,"url":"https://github.com/apiverve/dns-lookup-go-tutorial","last_synced_at":"2026-06-25T08:01:59.285Z","repository":{"id":338744177,"uuid":"1158967346","full_name":"apiverve/dns-lookup-go-tutorial","owner":"apiverve","description":"DNS lookup tool that retrieves DNS records using Go","archived":false,"fork":false,"pushed_at":"2026-02-16T07:40:32.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-16T14:17:58.159Z","etag":null,"topics":["apiverve","cli","devops","dns","dns-lookup","go","golang","networking","tutorial"],"latest_commit_sha":null,"homepage":"https://apiverve.com/marketplace/dnslookup","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apiverve.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-16T06:24:01.000Z","updated_at":"2026-02-16T07:40:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/apiverve/dns-lookup-go-tutorial","commit_stats":null,"previous_names":["apiverve/dns-lookup-go-tutorial"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/apiverve/dns-lookup-go-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiverve%2Fdns-lookup-go-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiverve%2Fdns-lookup-go-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiverve%2Fdns-lookup-go-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiverve%2Fdns-lookup-go-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apiverve","download_url":"https://codeload.github.com/apiverve/dns-lookup-go-tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiverve%2Fdns-lookup-go-tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34765322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apiverve","cli","devops","dns","dns-lookup","go","golang","networking","tutorial"],"created_at":"2026-06-25T08:01:59.193Z","updated_at":"2026-06-25T08:01:59.274Z","avatar_url":"https://github.com/apiverve.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DNS Lookup Tool | APIVerve API Tutorial\r\n\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\r\n[![Build](https://img.shields.io/badge/Build-Passing-brightgreen.svg)]()\r\n[![Go](https://img.shields.io/badge/Go-1.21+-00add8)](https://go.dev)\r\n[![APIVerve | DNS Lookup](https://img.shields.io/badge/APIVerve-DNS_Lookup-purple)](https://apiverve.com/marketplace/dnslookup?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=dns-lookup-go-tutorial)\r\n\r\nA Go CLI tool that looks up DNS records for any domain. View A, AAAA, MX, TXT, NS, and CNAME records.\r\n\r\n![Screenshot](https://raw.githubusercontent.com/apiverve/dns-lookup-go-tutorial/main/screenshot.jpg)\r\n\r\n---\r\n\r\n### Get Your Free API Key\r\n\r\nThis tutorial requires an APIVerve API key. **[Sign up free](https://dashboard.apiverve.com?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=dns-lookup-go-tutorial)** - no credit card required.\r\n\r\n---\r\n\r\n## Features\r\n\r\n- Look up all DNS record types\r\n- View A records (IPv4 addresses)\r\n- View AAAA records (IPv6 addresses)\r\n- View MX records with priorities\r\n- View NS records (nameservers)\r\n- View TXT records (SPF, DKIM, etc.)\r\n- View CNAME records\r\n- Interactive mode or command-line arguments\r\n- No external dependencies (standard library only)\r\n\r\n## Quick Start\r\n\r\n1. **Clone this repository**\r\n   ```bash\r\n   git clone https://github.com/apiverve/dns-lookup-go-tutorial.git\r\n   cd dns-lookup-go-tutorial\r\n   ```\r\n\r\n2. **Add your API key**\r\n\r\n   Open `main.go` and replace the API key:\r\n   ```go\r\n   const apiKey = \"your-api-key-here\"\r\n   ```\r\n\r\n3. **Run the tool**\r\n\r\n   Interactive mode:\r\n   ```bash\r\n   go run main.go\r\n   ```\r\n\r\n   Command line mode:\r\n   ```bash\r\n   go run main.go google.com\r\n   ```\r\n\r\n4. **Build executable (optional)**\r\n   ```bash\r\n   go build -o dns-lookup main.go\r\n   ./dns-lookup google.com\r\n   ```\r\n\r\n## Usage Examples\r\n\r\n### Look up a domain\r\n```bash\r\n$ go run main.go github.com\r\n\r\n=======================================================\r\n  DNS Records: github.com\r\n=======================================================\r\n\r\n  A Records (IPv4)\r\n  ---------------------------------------------------\r\n    140.82.112.3\r\n    140.82.112.4\r\n\r\n  AAAA Records (IPv6)\r\n  ---------------------------------------------------\r\n    (none)\r\n\r\n  MX Records (Mail)\r\n  ---------------------------------------------------\r\n    [1] aspmx.l.google.com\r\n    [5] alt1.aspmx.l.google.com\r\n    [10] alt2.aspmx.l.google.com\r\n\r\n  NS Records (Nameservers)\r\n  ---------------------------------------------------\r\n    dns1.p08.nsone.net\r\n    dns2.p08.nsone.net\r\n    dns3.p08.nsone.net\r\n    dns4.p08.nsone.net\r\n\r\n  TXT Records\r\n  ---------------------------------------------------\r\n    v=spf1 include:_spf.google.com include:servers...\r\n    MS=ms12345678\r\n\r\n=======================================================\r\n```\r\n\r\n## Project Structure\r\n\r\n```\r\ndns-lookup-go-tutorial/\r\n├── main.go             # Main Go source file\r\n├── go.mod              # Go module file\r\n├── screenshot.jpg      # Preview image\r\n├── LICENSE             # MIT license\r\n├── .gitignore          # Git ignore rules\r\n└── README.md           # This file\r\n```\r\n\r\n## How It Works\r\n\r\n1. User provides a domain name\r\n2. Go program cleans the input\r\n3. HTTP request sent to DNS Lookup API\r\n4. JSON response parsed into Go structs\r\n5. Records displayed in formatted output\r\n\r\n### The API Call\r\n\r\n```go\r\nreq, _ := http.NewRequest(\"GET\", apiURL+\"?domain=\"+domain, nil)\r\nreq.Header.Set(\"x-api-key\", apiKey)\r\n\r\nclient := \u0026http.Client{}\r\nresp, _ := client.Do(req)\r\n```\r\n\r\n## API Reference\r\n\r\n**Endpoint:** `GET https://api.apiverve.com/v1/dnslookup`\r\n\r\n**Query Parameters:**\r\n\r\n| Parameter | Type | Required | Description |\r\n|-----------|------|----------|-------------|\r\n| `domain` | string | Yes | Domain to look up (e.g., \"google.com\") |\r\n\r\n**Example Response:**\r\n\r\n```json\r\n{\r\n  \"status\": \"ok\",\r\n  \"error\": null,\r\n  \"data\": {\r\n    \"domain\": \"myspace.com\",\r\n    \"records\": {\r\n      \"A\": [\"34.111.176.156\"],\r\n      \"MX\": [\r\n        {\"exchange\": \"us-smtp-inbound-1.mimecast.com\", \"priority\": 10},\r\n        {\"exchange\": \"us-smtp-inbound-2.mimecast.com\", \"priority\": 10}\r\n      ],\r\n      \"NS\": [\r\n        \"ns-cloud-a1.googledomains.com\",\r\n        \"ns-cloud-a2.googledomains.com\"\r\n      ],\r\n      \"TXT\": [\"v=spf1 mx ip4:63.208.226.34 ...\"]\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n## DNS Record Types\r\n\r\n| Type | Description |\r\n|------|-------------|\r\n| A | IPv4 address |\r\n| AAAA | IPv6 address |\r\n| MX | Mail exchange (email servers) |\r\n| NS | Nameservers |\r\n| TXT | Text records (SPF, DKIM, verification) |\r\n| CNAME | Canonical name (alias) |\r\n\r\n## Use Cases\r\n\r\n- **Network diagnostics** - Troubleshoot DNS issues\r\n- **Email setup** - Verify MX records\r\n- **Security checks** - Review SPF/DKIM records\r\n- **Domain migration** - Verify DNS propagation\r\n- **DevOps** - Automate DNS verification\r\n\r\n## Customization Ideas\r\n\r\n- Add JSON output format\r\n- Query specific record types only\r\n- Compare DNS across multiple resolvers\r\n- Build a web interface\r\n- Add DNS propagation checking\r\n- Export results to file\r\n\r\n## Related APIs\r\n\r\nExplore more APIs at [APIVerve](https://apiverve.com/marketplace?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=dns-lookup-go-tutorial):\r\n\r\n- [SSL Checker](https://apiverve.com/marketplace/sslchecker?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=dns-lookup-go-tutorial) - Check SSL certificates\r\n- [WHOIS Lookup](https://apiverve.com/marketplace/whoislookup?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=dns-lookup-go-tutorial) - Domain registration info\r\n- [MX Lookup](https://apiverve.com/marketplace/mxlookup?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=dns-lookup-go-tutorial) - Mail server lookup\r\n\r\n## Free Plan Note\r\n\r\nThis tutorial works with the free APIVerve plan. Some APIs may have:\r\n- **Locked fields**: Premium response fields return `null` on free plans\r\n- **Ignored parameters**: Some optional parameters require a paid plan\r\n\r\nThe API response includes a `premium` object when limitations apply. [Upgrade anytime](https://dashboard.apiverve.com/plans) to unlock all features.\r\n\r\n## License\r\n\r\nMIT - see [LICENSE](LICENSE)\r\n\r\n## Links\r\n\r\n- [Get API Key](https://dashboard.apiverve.com?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=dns-lookup-go-tutorial) - Sign up free\r\n- [APIVerve Marketplace](https://apiverve.com/marketplace?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=dns-lookup-go-tutorial) - Browse 300+ APIs\r\n- [DNS Lookup API](https://apiverve.com/marketplace/dnslookup?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=dns-lookup-go-tutorial) - API details\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapiverve%2Fdns-lookup-go-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapiverve%2Fdns-lookup-go-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapiverve%2Fdns-lookup-go-tutorial/lists"}