Software /
code /
prosody
Comparison
net/dns.lua @ 1816:1c0bde3db7d8
Merge with 0.5
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 24 Sep 2009 11:16:25 +0100 |
parent | 1807:3bb0e5170692 |
parent | 1815:e2f0c514d039 |
child | 1823:7c3ec7ac6316 |
comparison
equal
deleted
inserted
replaced
1807:3bb0e5170692 | 1816:1c0bde3db7d8 |
---|---|
505 | 505 |
506 function resolver:adddefaultnameservers () -- - - - - adddefaultnameservers | 506 function resolver:adddefaultnameservers () -- - - - - adddefaultnameservers |
507 local resolv_conf = io.open("/etc/resolv.conf"); | 507 local resolv_conf = io.open("/etc/resolv.conf"); |
508 if resolv_conf then | 508 if resolv_conf then |
509 for line in resolv_conf:lines() do | 509 for line in resolv_conf:lines() do |
510 local address = string.match (line, 'nameserver%s+(%d+%.%d+%.%d+%.%d+)') | 510 local address = string.match (line, '^%s*nameserver%s+(%d+%.%d+%.%d+%.%d+)') |
511 if address then self:addnameserver (address) end | 511 if address then self:addnameserver (address) end |
512 end | 512 end |
513 elseif os.getenv("WINDIR") then | 513 elseif os.getenv("WINDIR") then |
514 self:addnameserver ("208.67.222.222") | 514 self:addnameserver ("208.67.222.222") |
515 self:addnameserver ("208.67.220.220") | 515 self:addnameserver ("208.67.220.220") |
516 end | 516 end |