diff --git a/hosts.go b/hosts.go index 8357754..87bef5e 100644 --- a/hosts.go +++ b/hosts.go @@ -145,7 +145,7 @@ func (f *FileHosts) isDomain(domain string) bool { if f.isIP(domain) { return false } - match, _ := regexp.MatchString("^[a-zA-Z0-9][a-zA-Z0-9-]", domain) + match, _ := regexp.MatchString(`^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$`, domain) return match }