DNS
DNS feature allows collecting DNS information and records for any web scraped target website. It's useful for monitoring and tracking DNS changes.
Note that enabling DNS may slow down scraping speed.
DNS details can also be found in the monitoring dashboard logs under the DNS tab:
Usage
To use DNS feature the DNS parameter can be enabled on any
Scrapfly scrape request. This will include DNS details in the result.dns field:
const params = new URLSearchParams({
"dns": true,
"key": "__API_KEY__",
"url": "https://web-scraping.dev/",
});
const url = "https://api.scrapfly.io/scrape?" + params.toString();
const options = {
method: "GET",
};
try {
const response = await fetch(url, options);
if (!response.ok) {
const errorData = await response.json();
const errorMsg = errorData.message || errorData.description || 'Request failed';
throw new Error(`HTTP error ${response.status}: ${errorMsg}`);
}
const data = await response.json();
console.log(data);
// Access the scrape result
if (data.result) {
console.log(data.result);
}
} catch (error) {
console.error("Error:", error.message);
throw error;
}
https://api.scrapfly.io/scrape?dns=true&key=&url=https%3A%2F%2Fweb-scraping.dev%2F
Example Of Response
Pricing
No additional fee is applied on usage.