@ -121,6 +121,7 @@ type ServerConfig struct {
NamecoinRPCAddress string ` default:"localhost:8336" usage:"Namecoin RPC server address" `
CacheMaxEntries int ` default:"1000" usage:"Maximum name cache entries" `
SelfIP string ` default:"127.127.127.127" usage:"The canonical IP address for this service" `
SelfName string ` default:"" usage:"Canonical name for this nameserver (default: autogenerated psuedo-hostname resolving to SelfIP; SelfIP is not used if this is set)" `
}
func ( s * Server ) doRunListener ( ds * dns . Server ) {
@ -182,7 +183,11 @@ func (s *Server) handle(rw dns.ResponseWriter, reqMsg *dns.Msg) {
err := tx . addAnswers ( )
if err != nil {
if tx . rcode == 0 {
if err == ErrNoResults {
tx . rcode = 0
} else if err == ErrNoSuchDomain {
tx . rcode = dns . RcodeNameError
} else if tx . rcode == 0 {
log . Infoe ( err , "Handler error, doing SERVFAIL" )
tx . rcode = dns . RcodeServerFailure
}
@ -337,13 +342,13 @@ func (tx *Tx) addAnswersAuthoritative(rrs []dns.RR, origerr error) error {
// appropriate zone, fail with REFUSED
// ErrNoSuchDomain -- there are no records at this name of ANY type, nor are there at any
// direct or indirect descendant domain; fail with NXDOMAIN
// ErrNoResult -- There are no records of the given type of class. However, there are
// ErrNoResult s -- There are no records of the given type of class. However, there are
// other records at the given domain and/or records at a direct or
// indirect descendant domain; NOERROR
// any other error -- SERVFAIL
//
// If it succeeds:
// If there are zero records, treat the response as ErrNoResult above. Otherwise, each record
// If there are zero records, treat the response as ErrNoResult s above. Otherwise, each record
// can be classified into one of the following categories:
//
// - A NS record not at the zone apex and thus not authoritative (handled in addAnswersDelegation)