File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import (
1414 "math/big"
1515 "net"
1616 "os"
17+ "slices"
1718 "strconv"
1819 "strings"
1920
@@ -444,9 +445,16 @@ func findNameserversForDomain(
444445 return "" , nil , err
445446 }
446447 for _ , aRecord := range aRecords {
448+ tmpIp := net .ParseIP (aRecord .Rhs )
449+ // Skip duplicate IPs
450+ if slices .ContainsFunc (ret [nsRecord .Rhs ], func (x net.IP ) bool {
451+ return x .Equal (tmpIp )
452+ }) {
453+ continue
454+ }
447455 ret [nsRecord .Rhs ] = append (
448456 ret [nsRecord .Rhs ],
449- net . ParseIP ( aRecord . Rhs ) ,
457+ tmpIp ,
450458 )
451459 }
452460 }
@@ -468,9 +476,16 @@ func findNameserversForDomain(
468476 return "" , nil , err
469477 }
470478 for _ , aRecord := range aRecords {
479+ tmpIp := net .ParseIP (aRecord .Rhs )
480+ // Skip duplicate IPs
481+ if slices .ContainsFunc (ret [nsRecord .Rhs ], func (x net.IP ) bool {
482+ return x .Equal (tmpIp )
483+ }) {
484+ continue
485+ }
471486 ret [nsRecord .Rhs ] = append (
472487 ret [nsRecord .Rhs ],
473- net . ParseIP ( aRecord . Rhs ) ,
488+ tmpIp ,
474489 )
475490 }
476491 }
You can’t perform that action at this time.
0 commit comments