# HG changeset patch # User Matthew Wild # Date 1253787245 -3600 # Node ID e2f0c514d039582780e45832d7b9bc8be100ab7a # Parent 846224d7a3773935dbffd89e79b3c9aa86964ef7 net.dns: Respect commented nameserver entries in resolv.conf (thanks Remko) diff -r 846224d7a377 -r e2f0c514d039 net/dns.lua --- a/net/dns.lua Wed Sep 23 13:17:13 2009 +0100 +++ b/net/dns.lua Thu Sep 24 11:14:05 2009 +0100 @@ -507,8 +507,8 @@ local resolv_conf = io.open("/etc/resolv.conf"); if resolv_conf then for line in resolv_conf:lines() do - local address = string.match (line, 'nameserver%s+(%d+%.%d+%.%d+%.%d+)') - if address then self:addnameserver (address) end + local address = string.match (line, '^%s*nameserver%s+(%d+%.%d+%.%d+%.%d+)') + if address then self:addnameserver (address) end end elseif os.getenv("WINDIR") then self:addnameserver ("208.67.222.222")