Software /
code /
prosody
Comparison
net/dns.lua @ 1807:3bb0e5170692
net.dns: (for some reason this commit didn't pull over from 0.5) Remove hard-coded 4.2.2.1 from dns.lua
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 21 Sep 2009 14:46:12 +0100 |
parent | 1806:c55e06eb53b2 |
child | 1816:1c0bde3db7d8 |
comparison
equal
deleted
inserted
replaced
1806:c55e06eb53b2 | 1807:3bb0e5170692 |
---|---|
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 |