LookupServer: Rename setting "DNS/IPAddress" => "DNS/Nameserver"

This commit is contained in:
Andreas Kling 2020-01-26 14:51:38 +01:00
parent 0c544052a5
commit c26560ec26
Notes: sideshowbarker 2024-07-19 09:48:16 +09:00
3 changed files with 5 additions and 5 deletions

View file

@ -1,2 +1,2 @@
[DNS]
IPAddress=1.1.1.1
Nameserver=1.1.1.1

View file

@ -43,7 +43,7 @@ LookupServer::LookupServer()
{
auto config = CConfigFile::get_for_system("LookupServer");
dbg() << "Using network config file at " << config->file_name();
m_dns_ip = config->read_entry("DNS", "IPAddress", "127.0.0.53");
m_nameserver = config->read_entry("DNS", "Nameserver", "1.1.1.1");
load_etc_hosts();
@ -114,7 +114,7 @@ void LookupServer::service_client(RefPtr<CLocalSocket> socket)
return;
}
auto hostname = String((const char*)client_buffer + 1, nrecv - 1, Chomp);
dbg() << "Got request for '" << hostname << "' (using IP " << m_dns_ip << ")";
dbg() << "Got request for '" << hostname << "' (using IP " << m_nameserver << ")";
Vector<String> responses;
@ -182,7 +182,7 @@ Vector<String> LookupServer::lookup(const String& hostname, bool& did_timeout, u
return {};
}
if (!udp_socket->connect(m_dns_ip, 53))
if (!udp_socket->connect(m_nameserver, 53))
return {};
if (!udp_socket->write(buffer))

View file

@ -51,7 +51,7 @@ private:
};
RefPtr<CLocalServer> m_local_server;
String m_dns_ip;
String m_nameserver;
HashMap<String, String> m_dns_custom_hostnames;
HashMap<String, CachedLookup> m_lookup_cache;
};