Skip to content

Commit

Permalink
LookupServer: Rename setting "DNS/IPAddress" => "DNS/Nameserver"
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Jan 26, 2020
1 parent 0c54405 commit c26560e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Base/etc/LookupServer.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[DNS]
IPAddress=1.1.1.1
Nameserver=1.1.1.1
6 changes: 3 additions & 3 deletions Servers/LookupServer/LookupServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion Servers/LookupServer/LookupServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class LookupServer final : public CObject {
};

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;
};

0 comments on commit c26560e

Please sign in to comment.