Comparison

net/dns.lua @ 1805:7e41ad68fe3c

core.s2smanager: Don't recurse CNAMEs infinitely :)
author Matthew Wild <mwild1@gmail.com>
date Mon, 21 Sep 2009 14:40:14 +0100
parent 1786:4016d8bc30b8
child 1806:c55e06eb53b2
child 1809:36b82873b9cb
comparison
equal deleted inserted replaced
1804:f0f5ff6f82d6 1805:7e41ad68fe3c
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
507 local resolv_conf = io.open("/etc/resolv.conf"); 508 local resolv_conf = io.open("/etc/resolv.conf");
508 if resolv_conf then 509 if resolv_conf then
509 for line in resolv_conf:lines() do 510 for line in resolv_conf:lines() do
510 local address = string.match (line, 'nameserver%s+(%d+%.%d+%.%d+%.%d+)') 511 local address = string.match (line, 'nameserver%s+(%d+%.%d+%.%d+%.%d+)')
511 if address then self:addnameserver (address) end 512 if address then self:addnameserver (address) end