# HG changeset patch # User Matthew Wild # Date 1250599641 -3600 # Node ID 252afc358000045ec7da5c90ae50169e0fc3d840 # Parent 45a81d6d877778c896b56c9c4fa03beb81911548 net.dns: Automatically add nameserver 127.0.0.1 if /etc/resolv.conf missing or empty on a non-Windows system (thanks Louis Mamakos) diff -r 45a81d6d8777 -r 252afc358000 net/dns.lua --- a/net/dns.lua Tue Aug 18 13:03:35 2009 +0100 +++ b/net/dns.lua Tue Aug 18 13:47:21 2009 +0100 @@ -509,9 +509,12 @@ 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