Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

nodejs set dns for request

const { Resolver } = require('dns').promises;
const resolver = new Resolver();
resolver.setServers(['4.4.4.4']);

// This request will use the server at 4.4.4.4, independent of global settings.
resolver.resolve4('example.org').then((addresses) => {
  // ...
});

// Alternatively, the same code can be written using async-await style.
(async function() {
  const addresses = await resolver.resolve4('example.org');
})();
Comment

PREVIOUS NEXT
Code Example
Javascript :: js get copied text 
Javascript :: button dropdown not working on datatable search 
Javascript :: filter an array 
Javascript :: replace js 
Javascript :: export module in es6 
Javascript :: password validation in angular 
Javascript :: mangoose connection 
Javascript :: ckeditor config 
Javascript :: javascript array multidimensional push 
Javascript :: javascript check if consecutive array 
Javascript :: js remove first character from string 
Javascript :: redux saga fetch data 
Javascript :: classlist.contain in javascript 
Javascript :: scrollout js 
Javascript :: react strict mode 
Javascript :: Using axios send a GET request to the address: 
Javascript :: how to append object in array javascript 
Javascript :: variable javascript 
Javascript :: sliding element jquery 
Javascript :: remove object property javascript es6 
Javascript :: js format indian price with commas 
Javascript :: remove index from array javascript 
Javascript :: javascript window screen 
Javascript :: react why onclick property function trigger without click 
Javascript :: ajax file upload input 
Javascript :: angular scroll to element horizontally 
Javascript :: html form data to json 
Javascript :: javascript objects 
Javascript :: deleteicon material ui improt 
Javascript :: 2d array includes array js 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =