func (r BogonResolver) LookupHost(ctx context.Context, hostname string) ([]string, error) {
	addrs, err := r.Resolver.LookupHost(ctx, hostname)
	for _, addr := range addrs {
		if IsBogon(addr) == true {
			return addrs, errorx.ErrDNSBogon
		}
	}
	return addrs, err
}
LookupHost implements Resolver.LookupHost
package resolver
import (
	"context"
	"net"
	"github.com/ooni/probe-engine/internal/runtimex"
	"github.com/ooni/probe-engine/netx/errorx"
)
var privateIPBlocks []*net.IPNet
func init() {
	for _, cidr := range []string{
		"0.0.0.0/8",       
		"10.0.0.0/8",      
		"100.64.0.0/10",   
		"127.0.0.0/8",     
		"169.254.0.0/16",  
		"172.16.0.0/12",   
		"192.168.0.0/16",  
		"224.0.0.0/4",     
		"::1/128",         
		"fe80::/10",       
		"fc00::/7",        
	} {
		_, block, err := net.ParseCIDR(cidr)
		runtimex.PanicOnError(err, "net.ParseCIDR failed")
		privateIPBlocks = append(privateIPBlocks, block)
	}
}
func isPrivate(ip net.IP) bool {
	if ip.IsLoopback() || ip.IsLinkLocalUnicast() || ip.IsLinkLocalMulticast() {
		return true
	}
	for _, block := range privateIPBlocks {
		if block.Contains(ip) {
			return true
		}
	}
	return false
}
func IsBogon(address string) bool {
	ip := net.ParseIP(address)
	return ip == nil || isPrivate(ip)
}
type BogonResolver struct {
	Resolver
}