diff --git a/lib/krb5/krbhst.c b/lib/krb5/krbhst.c index 639b4326a..2aa29b72f 100644 --- a/lib/krb5/krbhst.c +++ b/lib/krb5/krbhst.c @@ -422,6 +422,15 @@ fallback_get_hosts(krb5_context context, struct krb5_krbhst_data *kd, struct addrinfo hints; char portstr[NI_MAXSERV]; + /* + * Don't try forever in case the DNS server keep returning us + * entries (like wildcard entries or the .nu TLD) + */ + if(kd->fallback_count >= 5) { + kd->flags |= KD_FALLBACK; + return 0; + } + if(kd->fallback_count == 0) asprintf(&host, "%s.%s.", serv_string, kd->realm); else