简体   繁体   中英

DNS Server IP address Update

I am new to Node.js and using the node.js I want to get the DNS server IP address of my connected interface.During searching I got on the node.js documentation that the 'DNS' module can be used for it and its function

dns.getServers() will return the address,

dns.setServers(servers) will set it.

when I call these functions and check it on console I show correct result but my problem is that I want to update it on the network interface setting in my Desktop PC system preference settings.

I also search that for getting the interfaces information in node.js,the 'OS' Module will be used and its function os.networkInterfaces() gives the interface details.

I think that there should be relation between these two modules to update the DNS server address to the interface.

Is it possible to do it or am I using a wrong approach.. please give some guidance and help.

Thanks

You will need to update the DNS of your network interface through the OS rather than Node.js

Any variables set in Node.js will not persist outside of that environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM