Changeset 923
- Timestamp:
- 11/16/06 22:10:54 (2 years ago)
- Files:
-
- trunk/pdns/pdns/docs/pdns.sgml (modified) (1 diff)
- trunk/pdns/pdns/iputils.hh (modified) (3 diffs)
- trunk/pdns/pdns/lwres.cc (modified) (1 diff)
- trunk/pdns/pdns/pdns_recursor.cc (modified) (3 diffs)
- trunk/pdns/pdns/syncres.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pdns/pdns/docs/pdns.sgml
r921 r923 6790 6790 <para> 6791 6791 A Verisign special. 6792 </para> 6793 </listitem> 6794 </varlistentry> 6795 <varlistentry> 6796 <term>dont-query</term> 6797 <listitem> 6798 <para> 6799 The DNS is a public database, but sometimes contains delegations to private IP addresses, like for example 127.0.0.1. This can have odd effects, 6800 depending on your network, and may even be a security risk. Therefore, since version 3.1.5, the PowerDNS recursor by default does not query 6801 private space IP addresses. This setting can be used to expand or reduce the limitations. 6792 6802 </para> 6793 6803 </listitem> trunk/pdns/pdns/iputils.hh
r916 r923 120 120 } 121 121 122 bool isMappedIPv4() 122 bool isMappedIPv4() const 123 123 { 124 124 if(sin4.sin_family!=AF_INET6) … … 138 138 } 139 139 140 ComboAddress mapToIPv4() 140 ComboAddress mapToIPv4() const 141 141 { 142 142 if(!isMappedIPv4()) … … 267 267 public: 268 268 //! If this IP address is matched by any of the classes within 269 bool match( ComboAddress *ip)269 bool match(const ComboAddress *ip) 270 270 { 271 271 for(container_t::const_iterator i=d_masks.begin();i!=d_masks.end();++i) trunk/pdns/pdns/lwres.cc
r904 r923 52 52 delete[] d_buf; 53 53 } 54 55 54 56 55 //! returns -2 for OS limits error, -1 for permanent error that has to do with remote, 0 for timeout, 1 for success trunk/pdns/pdns/pdns_recursor.cc
r917 r923 77 77 bool g_quiet; 78 78 NetmaskGroup* g_allowFrom; 79 NetmaskGroup* g_dontQuery; 79 80 string s_programname="pdns_recursor"; 80 81 typedef vector<int> g_tcpListenSockets_t; … … 1490 1491 L<<Logger::Error<<"WARNING: Allowing queries from all IP addresses - this can be a security risk!"<<endl; 1491 1492 1493 if(!::arg()["dont-query"].empty()) { 1494 g_dontQuery=new NetmaskGroup; 1495 vector<string> ips; 1496 stringtok(ips, ::arg()["dont-query"], ", "); 1497 L<<Logger::Warning<<"Will not send queries to: "; 1498 for(vector<string>::const_iterator i = ips.begin(); i!= ips.end(); ++i) { 1499 g_dontQuery->addMask(*i); 1500 if(i!=ips.begin()) 1501 L<<Logger::Warning<<", "; 1502 L<<Logger::Warning<<*i; 1503 } 1504 L<<Logger::Warning<<endl; 1505 } 1506 1492 1507 g_quiet=::arg().mustDo("quiet"); 1493 1508 if(::arg().mustDo("trace")) { … … 1698 1713 ::arg().set("version-string", "string reported on version.pdns or version.bind")="PowerDNS Recursor "VERSION" $Id$"; 1699 1714 ::arg().set("allow-from", "If set, only allow these comma separated netmasks to recurse")="127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fe80::/10"; 1715 ::arg().set("dont-query", "If set, do not query these netmasks for DNS data")="127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fe80::/10"; 1700 1716 ::arg().set("max-tcp-per-client", "If set, maximum number of TCP sessions per client (IP address)")="0"; 1701 1717 ::arg().set("fork", "If set, fork the daemon for possible double performance")="no"; trunk/pdns/pdns/syncres.cc
r919 r923 661 661 for(remoteIP = remoteIPs.begin(); remoteIP != remoteIPs.end(); ++remoteIP) { 662 662 LOG<<prefix<<qname<<": Trying IP "<< remoteIP->toString() <<", asking '"<<qname<<"|"<<qtype.getName()<<"'"<<endl; 663 extern NetmaskGroup* g_dontQuery; 663 664 664 665 if(s_throttle.shouldThrottle(d_now.tv_sec, make_tuple(*remoteIP, qname, qtype.getCode()))) { 665 666 LOG<<prefix<<qname<<": query throttled "<<endl; 666 667 s_throttledqueries++; d_throttledqueries++; 668 continue; 669 } 670 else if(g_dontQuery && g_dontQuery->match(&*remoteIP)) { 671 LOG<<prefix<<qname<<": not sending query to " << remoteIP->toString() << ", blocked by 'dont-query' setting" << endl; 667 672 continue; 668 673 }