mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2024-11-22 02:59:27 +01:00
myip.js: small fixes
This commit is contained in:
parent
d3864f2d06
commit
06bda324aa
@ -3,7 +3,7 @@
|
|||||||
// Require the dns module
|
// Require the dns module
|
||||||
var dns = require('dns');
|
var dns = require('dns');
|
||||||
|
|
||||||
// Set DNS servers to OpenDNS nes
|
// Set DNS servers to OpenDNS IPv4
|
||||||
var servers4 = dns.setServers(["208.67.222.222", "208.67.220.220"])
|
var servers4 = dns.setServers(["208.67.222.222", "208.67.220.220"])
|
||||||
|
|
||||||
// Check where myip.opendns.com resolves to and I think this is a function
|
// Check where myip.opendns.com resolves to and I think this is a function
|
||||||
@ -19,19 +19,28 @@ dns.resolve4('myip.opendns.com', function (err, addresses) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
// This code makes node codedump for some reason, maybe it has a bug
|
// This code makes node codedump for some reason, maybe it has a bug
|
||||||
// with IPv6 handling or it doesn't like my system not having native
|
// with IPv6 handling or it doesn't like my system not having native
|
||||||
// or not-Teredo IPv6 connectivity.
|
// or not-Teredo IPv6 connectivity.
|
||||||
|
|
||||||
var servers6 = dns.setServers(["2620:0:ccc::2", "2620:0:ccd::2"])
|
// node: ../deps/cares/src/ares_destroy.c:102: ares__destroy_servers_state: Assertion `ares__is_list_empty(&server->queries_to_server)' failed.
|
||||||
|
// zsh: abort (core dumped) ./myip.js
|
||||||
|
|
||||||
dns.resolve6('myip.opendns.com', function (err, addresses) {
|
/*
|
||||||
if (err) throw err;
|
|
||||||
|
|
||||||
console.log(addresses[0]);
|
// Set DNS servers to OpenDNS IPv6
|
||||||
|
var servers4 = dns.setServers(["2620:0:ccc::2", "2620:0:ccd::2"])
|
||||||
|
|
||||||
|
// Check where myip.opendns.com resolves to and I think this is a function
|
||||||
|
// that takes arguments err and addresses.
|
||||||
|
dns.resolve4('myip.opendns.com', function (err, addresses) {
|
||||||
|
|
||||||
|
// In case of error throw the error message?
|
||||||
|
if (err) throw err;
|
||||||
|
|
||||||
|
// Print the first thing in array addresses as it has our IPv4
|
||||||
|
// address.
|
||||||
|
console.log(addresses[0]);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user