checker: Improve error message about DNS

This commit is contained in:
nemunaire 2022-04-29 22:34:55 +02:00
parent 65dd0d51ca
commit 3108f13073

View File

@ -635,11 +635,11 @@ func studentChecker(std *adlin.Student, also_check_matrix bool, offline bool) {
// Check DNS
if addr, err := check_dns(std.MyDelegatedDomain(), dnsIP); err == nil {
if addr == nil {
dnsAt := " at " + dnsIP
dnsAt := ""
if glueErr != nil {
dnsAt = " + there is a problem with the GLUE record: " + glueErr.Error()
}
if errreg := std.RegisterChallengeError(CheckMap[tunnel_version][DNSDelegation], fmt.Errorf("%s: empty response from the server%s", std.MyDelegatedDomain(), dnsAt)); errreg != nil {
if errreg := std.RegisterChallengeError(CheckMap[tunnel_version][DNSDelegation], fmt.Errorf("dig @%s %s AAAA: empty response from the server%s", dnsIP, std.MyDelegatedDomain(), dnsAt)); errreg != nil {
log.Printf("Unable to register challenge error for %s: %s\n", std.Login, errreg)
}
} else if tunnel_version == 3 && dnsIP == stdIP {
@ -784,7 +784,7 @@ func studentChecker(std *adlin.Student, also_check_matrix bool, offline bool) {
}
}
} else {
if errreg := std.RegisterChallengeError(CheckMap[tunnel_version][DNSDelegation], err); errreg != nil {
if errreg := std.RegisterChallengeError(CheckMap[tunnel_version][DNSDelegation], fmt.Errorf("dig @%s %s: %w", dnsIP, std.MyDelegatedDomain(), err)); errreg != nil {
log.Printf("Unable to register challenge error for %s: %s\n", std.Login, errreg)
}
if verbose {