1 #include "../dns_proto.h"
7 if (
agent()->test_mode()) {
9 boost::system::error_code ec;
10 IpAddress ip = IpAddress::from_string(
"127.0.0.1", ec);
12 ip_list.push_back(ip);
18 fd.open(
"/etc/resolv.conf");
24 while (getline(fd, line)) {
25 std::size_t pos = line.find_first_of(
"#");
26 std::stringstream ss(line.substr(0, pos));
29 if (key ==
"nameserver") {
32 boost::system::error_code ec;
33 IpAddress ip = IpAddress::from_string(ip_str, ec);
35 ip_list.push_back(ip);
boost::asio::ip::address IpAddress
DefaultServerList BuildDefaultServerListImpl()
std::vector< IpAddress > DefaultServerList