Software /
code /
prosody
Comparison
net/dns.lua @ 1809:36b82873b9cb
net.dns: Accidentally committed a hard-coded 4.2.2.1 nameserver
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 21 Sep 2009 14:42:01 +0100 |
parent | 1805:7e41ad68fe3c |
child | 1815:e2f0c514d039 |
comparison
equal
deleted
inserted
replaced
1805:7e41ad68fe3c | 1809:36b82873b9cb |
---|---|
502 self:addnameserver (address) | 502 self:addnameserver (address) |
503 end | 503 end |
504 | 504 |
505 | 505 |
506 function resolver:adddefaultnameservers () -- - - - - adddefaultnameservers | 506 function resolver:adddefaultnameservers () -- - - - - adddefaultnameservers |
507 self:addnameserver("4.2.2.1"); do return; end | |
508 local resolv_conf = io.open("/etc/resolv.conf"); | 507 local resolv_conf = io.open("/etc/resolv.conf"); |
509 if resolv_conf then | 508 if resolv_conf then |
510 for line in resolv_conf:lines() do | 509 for line in resolv_conf:lines() do |
511 local address = string.match (line, 'nameserver%s+(%d+%.%d+%.%d+%.%d+)') | 510 local address = string.match (line, 'nameserver%s+(%d+%.%d+%.%d+%.%d+)') |
512 if address then self:addnameserver (address) end | 511 if address then self:addnameserver (address) end |