Skip to content

proconnect-gouv/mx-resolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📡 MX Resolver

Minimal HTTP service that resolves MX records for a domain. Exists as a separate process because the calling server operates under a security policy that prohibits outbound DNS MX queries directly.

Usage

curl https://mx-resolver.proconnect.gouv.fr/beta.gouv.fr
[{ "exchange": "mx.ox.numerique.gouv.fr", "priority": 1 }]
curl https://mx-resolver.proconnect.gouv.fr/alpha.gouv.fr
{ "error": "ENODATA alpha.gouv.fr" }

API

GET /:domain

200 — MX records found

[{ "exchange": "mx.ox.numerique.gouv.fr", "priority": 1 }]

400 — missing or invalid domain

{ "error": "domain required" }
{ "error": "invalid domain" }

404 — no MX records (ENODATA, ENOTFOUND)

{ "error": "ENODATA alpha.gouv.fr" }

504 — DNS resolver did not respond within 5 seconds

{ "error": "DNS timeout" }

Run

# Default
# PORT=3000
# RESOLVE_TIMEOUT_MS=5000
node --experimental-strip-types main.ts

About

📡 MX record lookup utility

Resources

License

Stars

Watchers

Forks

Contributors