Changeset 415

Show
Ignore:
Timestamp:
06/21/05 21:37:40 (8 years ago)
Author:
ahu
Message:

improve logging a bit, add --query-local-address

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/pdns_recursor.cc

    r414 r415  
    231231   
    232232  sin.sin_family = AF_INET; 
    233   sin.sin_addr.s_addr = INADDR_ANY; 
    234    
     233 
     234  if(!IpToU32(arg()["query-local-address"], &sin.sin_addr.s_addr)) 
     235    throw AhuException("Unable to resolve local address '"+ arg()["query-local-address"] +"'");  
     236 
    235237  int tries=10; 
    236238  while(--tries) { 
     
    246248 
    247249  Utility::setNonBlocking(d_clientsock); 
     250  L<<Logger::Error<<"Sending UDP queries from "<<inet_ntoa(sin.sin_addr)<<":"<< ntohs(sin.sin_port)  <<endl; 
    248251} 
    249252 
     
    289292  } 
    290293} 
    291  
    292294 
    293295void makeUDPServerSockets() 
     
    430432    arg().set("socket-dir","Where the controlsocket will live")=LOCALSTATEDIR; 
    431433    arg().set("delegation-only","Which domains we only accept delegations from")=""; 
     434    arg().set("query-local-address","Source IP address for sending queries")=""; 
     435 
    432436    arg().setCmd("help","Provide a helpful message"); 
    433437    L.toConsole(Logger::Warning); 
     
    451455 
    452456    L.setName("pdns_recursor"); 
     457 
     458    L<<Logger::Warning<<"PowerDNS recursor "<<VERSION<<" (C) 2001-2005 PowerDNS.COM BV ("<<__DATE__", "__TIME__; 
     459#ifdef __GNUC__ 
     460    L<<", gcc "__VERSION__; 
     461#endif // add other compilers here 
     462    L<<") starting up"<<endl; 
     463 
     464  L<<Logger::Warning<<"PowerDNS comes with ABSOLUTELY NO WARRANTY. " 
     465    "This is free software, and you are welcome to redistribute it " 
     466    "according to the terms of the GPL version 2."<<endl; 
     467 
    453468 
    454469    if(arg().mustDo("trace"))