From: Pieter Lexis Date: Mon, 19 Feb 2018 16:19:22 +0000 (+0100) Subject: recursor: Allow disabling NSID and id.server X-Git-Tag: dnsdist-1.3.1~50^2~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=950626be4fdd9e6188a6649596852c58170947a4;p=pdns recursor: Allow disabling NSID and id.server As is the case with the auth. --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 67a48673a..e25a30148 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -3676,7 +3676,7 @@ int main(int argc, char **argv) ::arg().set("packetcache-ttl", "maximum number of seconds to keep a cached entry in packetcache")="3600"; ::arg().set("max-packetcache-entries", "maximum number of entries to keep in the packetcache")="500000"; ::arg().set("packetcache-servfail-ttl", "maximum number of seconds to keep a cached servfail entry in packetcache")="60"; - ::arg().set("server-id", "Returned when queried for 'id.server' TXT or NSID, defaults to hostname")=""; + ::arg().set("server-id", "Returned when queried for 'id.server' TXT or NSID, defaults to hostname, set custom or 'disabled'")=""; ::arg().set("stats-ringbuffer-entries", "maximum number of packets to store statistics for")="10000"; ::arg().set("version-string", "string reported on version.pdns or version.bind")=fullVersionString(); ::arg().set("allow-from", "If set, only allow these comma separated netmasks to recurse")=LOCAL_NETS; diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 694f3d4c2..c9a82b402 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -193,7 +193,7 @@ bool SyncRes::doSpecialNamesResolve(const DNSName &qname, const QType &qtype, co if (qtype == QType::TXT || qtype == QType::ANY) { if(qname == versionbind || qname == versionpdns) answers.push_back({QType::TXT, "\""+::arg()["version-string"]+"\""}); - else + else if (s_serverID != "disabled") answers.push_back({QType::TXT, "\""+s_serverID+"\""}); } }