Changeset 963
- Timestamp:
- 02/19/07 22:04:32 (2 years ago)
- Files:
-
- trunk/pdns/pdns/docs/pdns.sgml (modified) (1 diff)
- trunk/pdns/pdns/docs/pdns_recursor.1.txt (modified) (1 diff)
- trunk/pdns/pdns/misc.hh (modified) (1 diff)
- trunk/pdns/pdns/pdns_recursor.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pdns/pdns/docs/pdns.sgml
r944 r963 6842 6842 Comma separated list of 'zonename=IP' pairs. Queries for zones listed here will be forwarded to the IP address listed. 6843 6843 <command>forward-zones= ds9a.nl=213.244.168.210, powerdns.com=127.0.0.1</command>. Available since 3.1. 6844 </para> 6845 </listitem> 6846 </varlistentry> 6847 <varlistentry> 6848 <term>forward-zones-file</term> 6849 <listitem> 6850 <para> 6851 Same as <command>forward-zones</command>, parsed from a file. Only 1 zone is allowed per line, specified as follows: 6852 <command>ds9a.nl=213.244.168.210</command>. Available since 3.1.5. 6844 6853 </para> 6845 6854 </listitem> trunk/pdns/pdns/docs/pdns_recursor.1.txt
r838 r963 90 90 Available since 3.1. 91 91 92 --forward-zones-file:: 93 listed here will be forwarded to the IP address listed. 94 One zone per line, like: ds9a.nl=213.244.168.210 95 Available since 3.1.5 96 92 97 --hint-file:: 93 98 If set, load root hints from this file trunk/pdns/pdns/misc.hh
r953 r963 20 20 #define MISC_HH 21 21 22 #if 122 #if 0 23 23 #define RDTSC(qp) \ 24 24 do { \ trunk/pdns/pdns/pdns_recursor.cc
r955 r963 820 820 ComboAddress fromaddr; 821 821 socklen_t addrlen=sizeof(fromaddr); 822 uint64_t tsc1, tsc2;822 // uint64_t tsc1, tsc2; 823 823 824 824 if((len=recvfrom(fd, data, sizeof(data), 0, (sockaddr *)&fromaddr, &addrlen)) >= 0) { 825 RDTSC(tsc1);825 // RDTSC(tsc1); 826 826 g_stats.addRemote(fromaddr); 827 827 … … 842 842 else { 843 843 ++g_stats.qcounter; 844 #if 0 844 845 uint16_t type; 845 846 char qname[256]; … … 893 894 } 894 895 slow: 896 #endif 895 897 DNSComboWriter* dc = new DNSComboWriter(data, len, g_now); 896 898 dc->setSocket(fd); … … 1482 1484 } 1483 1485 1486 if(!::arg()["forward-zones-file"].empty()) { 1487 L<<Logger::Warning<<"Reading zone forwarding information from '"<<::arg()["forward-zones-file"]<<"'"<<endl; 1488 SyncRes::AuthDomain ad; 1489 FILE *rfp=fopen(::arg()["forward-zones-file"].c_str(), "r"); 1490 1491 if(!rfp) 1492 throw AhuException("Error opening forward-zones-file '"+::arg()["forward-zones-file"]+"': "+stringerror()); 1493 1494 shared_ptr<FILE> fp=shared_ptr<FILE>(rfp, fclose); 1495 1496 char line[1024]; 1497 vector<string> parts; 1498 int linenum=0; 1499 uint64_t before = SyncRes::s_domainmap.size(); 1500 while(linenum++, fgets(line, sizeof(line)-1, fp.get())) { 1501 parts.clear(); 1502 stringtok(parts,line,"=, "); 1503 if(parts.empty()) 1504 continue; 1505 if(parts.size()<2) 1506 throw AhuException("Error parsing line "+lexical_cast<string>(linenum)+" of " +::arg()["forward-zones-file"]); 1507 trim(parts[0]); 1508 trim(parts[1]); 1509 parts[0]=toCanonic("", parts[0]); 1510 ad.d_server=parts[1]; 1511 // cerr<<"Inserting '"<<domain<<"' to '"<<ad.d_server<<"'\n"; 1512 SyncRes::s_domainmap[parts[0]]=ad; 1513 } 1514 L<<Logger::Warning<<"Done parsing " << SyncRes::s_domainmap.size() - before<<" forwarding instructions"<<endl; 1515 } 1516 1484 1517 if(::arg().mustDo("export-etc-hosts")) { 1485 1518 string line; … … 1607 1640 SyncRes::s_serverID=tmp; 1608 1641 } 1609 1610 1642 1611 1643 parseAuthAndForwards(); … … 1802 1834 ::arg().set("auth-zones", "Zones for which we have authoritative data, comma separated domain=file pairs ")=""; 1803 1835 ::arg().set("forward-zones", "Zones for which we forward queries, comma separated domain=ip pairs")=""; 1836 ::arg().set("forward-zones-file", "File with domain=ip pairs for forwarding")=""; 1804 1837 ::arg().set("export-etc-hosts", "If we should serve up contents from /etc/hosts")="off"; 1805 1838 ::arg().set("serve-rfc1918", "If we should be authoritative for RFC 1918 private IP space")="";