Am trying to get a service ticket for a host based service and validate that using a keytab. The issue is that this is working sometimes and some times am observing 'Cannot contact any realm 'test.domain.com' while executing krb5_get_credentials() method. This error is not observed while sending AS-REQ. From the packet traces, I could see that AS-REQ/AS-REP without fail and the user is getting authenticated. Can anyone please share some pointers to resolve the issue?