aboutsummaryrefslogtreecommitdiffstats
path: root/net/dns.lua
diff options
context:
space:
mode:
Diffstat (limited to 'net/dns.lua')
-rw-r--r--net/dns.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/dns.lua b/net/dns.lua
index 48c08218..592471bb 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -17,6 +17,7 @@
require 'socket'
local ztact = require 'util.ztact'
local require = require
+local os = os;
local coroutine, io, math, socket, string, table =
coroutine, io, math, socket, string, table
@@ -509,9 +510,12 @@ function resolver:adddefaultnameservers () -- - - - - adddefaultnameservers
local address = string.match (line, 'nameserver%s+(%d+%.%d+%.%d+%.%d+)')
if address then self:addnameserver (address) end
end
- else -- FIXME correct for windows, using opendns nameservers for now
- self:addnameserver ("208.67.222.222")
- self:addnameserver ("208.67.220.220")
+ elseif os.getenv("WINDIR") then
+ self:addnameserver ("208.67.222.222")
+ self:addnameserver ("208.67.220.220")
+ end
+ if not self.server or #self.server == 0 then
+ self:addnameserver("127.0.0.1");
end
end