Prepare the use of multiple domains

This commit is contained in:
nemunaire 2022-03-05 12:04:59 +01:00
commit dd29c8ce92
3 changed files with 27 additions and 18 deletions

View file

@ -53,11 +53,12 @@ func check_ping(ip string, cb func(pkt *ping.Packet)) (err error) {
// PORT 53
func get_GLUE(domain string) (aaaa net.IP, err error) {
func get_GLUE(student *adlin.Student) (aaaa net.IP, err error) {
client := dns.Client{Net: "tcp", Timeout: time.Second * 5}
domain := student.MyDelegatedDomain()
dnssrv := "[2a01:e0a:2b:2250::b]:53"
if strings.HasSuffix(domain, adlin.DelegatedDomainSuffix) {
if strings.HasSuffix(domain, student.MyDelegatedDomainSuffix()) {
dnssrv = "[2a01:e0a:2b:2250::b]:53"
} else if v, ok := domainsHostingMap[domain]; ok {
dnssrv = v
@ -607,7 +608,7 @@ func studentChecker(std *adlin.Student, also_check_matrix bool) {
dnsIP := stdIP
var glueErr error
// Is GLUE defined?
if glueIP, err := get_GLUE(std.MyDelegatedDomain()); glueIP != nil {
if glueIP, err := get_GLUE(std); glueIP != nil {
dnsIP = glueIP.String()
if verbose {