A simple Go API server that provides DNS query endpoints for various record types.
- A Records: Query IPv4 addresses
- AAAA Records: Query IPv6 addresses
- TXT Records: Query text records
- MX Records: Query mail exchange records
- SRV Records: Query service records
go run main.goThe server will start on port 8086.
curl "http://localhost:8086/dns/a?domain=google.com"curl "http://localhost:8086/dns/aaaa?domain=google.com"curl "http://localhost:8086/dns/txt?domain=google.com"curl "http://localhost:8086/dns/mx?domain=google.com"curl "http://localhost:8086/dns/srv?service=xmpp-server&proto=tcp&name=gmail.com"curl "http://localhost:8086/health"{
"domain": "google.com",
"type": "A",
"records": [
"142.250.185.46"
]
}{
"domain": "google.com",
"type": "MX",
"records": [
{
"host": "smtp.google.com.",
"priority": 10
}
]
}{
"domain": "_xmpp-server._tcp.gmail.com",
"type": "SRV",
"records": [
{
"target": "xmpp-server.l.google.com.",
"port": 5269,
"priority": 5,
"weight": 0
}
]
}