Software /
code /
prosody
Comparison
net/dns.lua @ 1806:c55e06eb53b2
Merge with 0.5
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 21 Sep 2009 14:42:29 +0100 |
parent | 1788:45779d67c26c |
parent | 1805:7e41ad68fe3c |
child | 1807:3bb0e5170692 |
comparison
equal
deleted
inserted
replaced
1803:7fef8649d0f6 | 1806:c55e06eb53b2 |
---|---|
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 |