This commit is contained in:
j2rong4cn 2025-05-01 11:40:31 +08:00
parent a6e8fe409a
commit 13b70d5543
2 changed files with 7 additions and 1 deletions

View file

@ -86,6 +86,9 @@ func (h *StaticHosts) lookup(domain string, option dns.IPOption, maxDepth int) (
return addrs, nil
case len(addrs) == 1:
if err, ok := addrs[0].(dns.RCodeError); ok {
if uint16(err) == 0 {
return nil, dns.ErrEmptyResponse
}
return nil, err
}
if addrs[0].Family().IsDomain() { // Try to unwrap domain