DNS Records
Check DNS records and subdomains
Path Parameters
Name
Type
Description
Query Parameters
Name
Type
Description
Headers
Name
Type
Description
Examples
Last updated
Check DNS records and subdomains
Last updated
const domain = 'openai.com'
// text/plain - get DNS records as they are discovered (stream)
fetch(`/domains/${domain}/dns-records?key=_api_key_`)
.then(async response => {
if (response.ok) {
const reader = response.body.getReader()
const decoder = new TextDecoder()
while (true) {
const {done, value} = await reader.read();
if (done) return;
// dns record line
console.log(decoder.decode(value))
}
}
})
// text/plain - wait for full response
fetch(`/domains/${domain}/dns-records?key=_api_key_`)
.then(response => response.text())
.then(dnsRecords => {
console.log('all DNS Records', dnsRecords)
})
// application/json
fetch(`/domains/${domain}/dns-records?key=_api_key_`, {
headers: {
accept: 'application/json',
}
})
.then(response => response.json())
.then(dnsRecords => {
console.log('all DNS Records', dnsRecords)
})import axios from 'axios'
const domain = 'github.com'
const { data: dnsRecords } = await axios(`https://domains-api.com/domain/${domain}/dns-records?key=_key_`, {
headers: {
accept: 'application/json'
}
})
console.log('all dns records', dnsRecords)