diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-09-24 11:14:05 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-09-24 11:14:05 +0100 |
commit | e0c4e19bab9f19717c626bba804f2421823d2be7 (patch) | |
tree | a1239918e687ce4d3e12f64c3e2529290bd5c678 | |
parent | 5d726e1c28b1c004632fabeb49d1ad3a0741605e (diff) | |
download | prosody-e0c4e19bab9f19717c626bba804f2421823d2be7.tar.gz prosody-e0c4e19bab9f19717c626bba804f2421823d2be7.zip |
net.dns: Respect commented nameserver entries in resolv.conf (thanks Remko)
-rw-r--r-- | net/dns.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dns.lua b/net/dns.lua index ff07d26e..da06ceaa 100644 --- a/net/dns.lua +++ b/net/dns.lua @@ -507,8 +507,8 @@ function resolver:adddefaultnameservers () -- - - - - adddefaultnameservers 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") |