aboutsummaryrefslogtreecommitdiffstats
path: root/net/dns.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-09-25 01:35:46 +0100
committerMatthew Wild <mwild1@gmail.com>2009-09-25 01:35:46 +0100
commit4248f6078f66b450a2e9dc5e310ef10c3ed87bb0 (patch)
treeb4ba4e3258dd1f6f5c057cbecc9b7e61edd59775 /net/dns.lua
parent9118f712274368d5794fb8b8a2831f678ae1c15b (diff)
downloadprosody-4248f6078f66b450a2e9dc5e310ef10c3ed87bb0.tar.gz
prosody-4248f6078f66b450a2e9dc5e310ef10c3ed87bb0.zip
net.dns: Even better parsing of nameservers from resolv.conf
Diffstat (limited to 'net/dns.lua')
-rw-r--r--net/dns.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dns.lua b/net/dns.lua
index d6462031..e793c397 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -510,7 +510,7 @@ 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, '^%s*nameserver%s+(%d+%.%d+%.%d+%.%d+)%s*$')
+ local address = line:gsub("#.*$", ""):match('^%s*nameserver%s+(%d+%.%d+%.%d+%.%d+)%s*$')
if address then self:addnameserver (address) end
end
elseif os.getenv("WINDIR") then