Skip to content

feat(dns): added DNS Lookup Simulator tool#58

Open
Tech-Psycho95 wants to merge 5 commits intobetterbugs:developfrom
Tech-Psycho95:develop
Open

feat(dns): added DNS Lookup Simulator tool#58
Tech-Psycho95 wants to merge 5 commits intobetterbugs:developfrom
Tech-Psycho95:develop

Conversation

@Tech-Psycho95
Copy link

Summary

Adds a new DNS Lookup Simulator tool that allows users to query DNS records for any domain using secure DNS-over-HTTPS (DoH) providers.

Changes

New Files:

  • app/api/dns-lookup/route.ts - Backend API endpoint
  • app/components/developmentToolsComponent/dnsLookupSimulator.tsx - Frontend component

Modified Files:

  • app/libs/constants.tsx - Added import, path, route, and homepage listing (Category177)
  • app/libs/developmentToolsConstant.tsx - Added tool documentation and SEO metadata

Features

Frontend:

  • Domain name input with Enter key support
  • Record type dropdown (A, AAAA, CNAME, MX, TXT, NS)
  • DNS provider selector (Cloudflare/Google)
  • Loading spinner during queries
  • Copy-to-clipboard for individual values and all records
  • Color-coded record type badges
  • Human-readable TTL formatting (e.g., "1h 30m")
  • Error and empty state handling

Backend:

  • Secure DNS-over-HTTPS queries via Cloudflare and Google
  • Automatic provider fallback on failure
  • Domain validation and sanitization
  • MX record priority parsing
  • Structured JSON response with TTL values
  • 5-minute response caching

Testing

  1. Start dev server: npm run dev
  2. Navigate to http://localhost:3000/dns-lookup-simulator
  3. Enter google.com and click Lookup
  4. Test different record types (MX, TXT, NS, etc.)
  5. Test copy buttons and provider switching
  6. Test error handling with invalid domains

API Usage

  • GET /api/dns-lookup?domain=example.com&type=A&provider=cloudflare
Parameter Required Default Values
domain Yes - Any valid domain
type No A A, AAAA, CNAME, MX, TXT, NS
provider No cloudflare cloudflare, google

Screenshots

Screenshot 2026-03-02 023739 Screenshot 2026-03-02 023834

Testing Checklist

  • Start dev server: npm run dev
  • Navigate to http://localhost:3000/dns-lookup-simulator
  • Tool is visible on homepage under "Dev Utils" or via search
  • Enter google.com and click Lookup - results appear
  • Test A record type - shows IPv4 addresses
  • Test AAAA record type - shows IPv6 addresses
  • Test MX record type - shows mail servers with priority
  • Test TXT record type - shows text records
  • Test NS record type - shows name servers
  • Test CNAME record type
  • Switch DNS provider to Google - lookup works
  • Copy individual record value - copies to clipboard
  • Copy All button - copies all records
  • Clear button - clears domain and results
  • Enter key triggers lookup
  • Invalid domain shows error message
  • Empty domain shows validation error
  • Loading spinner appears during lookup
  • Mobile responsive layout works

Closes Issue #31

- Add backend API endpoint (/api/dns-lookup) using DNS-over-HTTPS
- Add React frontend component with record type selector
- Support A, AAAA, CNAME, MX, TXT, NS record types
- Integrate Cloudflare and Google DNS providers with fallback
- Include copy-to-clipboard, loading states, and error handling
- Add tool documentation and SEO metadata
- Add backend API endpoint (/api/dns-lookup) using DNS-over-HTTPS
- Add React frontend component with record type selector
- Support A, AAAA, CNAME, MX, TXT, NS record types
- Integrate Cloudflare and Google DNS providers with fallback
- Include copy-to-clipboard, loading states, and error handling
- Add tool documentation and SEO metadata

fix: added DNS Lookup Simulator tool to homepage tool listing
@Tech-Psycho95 Tech-Psycho95 marked this pull request as ready for review March 1, 2026 21:12
@Tech-Psycho95 Tech-Psycho95 changed the title feat(dns): add DNS Lookup Simulator tool and homepage listing feat(dns): add DNS Lookup Simulator tool Mar 1, 2026
@Tech-Psycho95 Tech-Psycho95 changed the title feat(dns): add DNS Lookup Simulator tool feat(dns): added DNS Lookup Simulator tool Mar 1, 2026
@rishima17 rishima17 requested a review from SyedFahad7 March 2, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants