Intermittent problem - Cannot resolve host

Posted on

==============================================================
Sometimes Openshift CRC Build (invoking maven build for github hosted source code, either directly or from jenkins) gives following error
stderr: fatal: unable to access 'https://github.com/....git/': Could not resolve host: github.com host "github.com"

To investigate the same, I logged into cluster console ( ssh -i ~/.crc/machines/crc/id_ecdsa core@... )

A] Following is the initial output of few commands

[core@crc-4727w-master-0 ~]$ ping github.com
PING github.com (13.234.210.38) 56(84) bytes of data.
64 bytes from ec2-13-234-210-38.ap-south-1.compute.amazonaws.com (13.234.210.38): icmp_seq=1 ttl=48 time=46.6 ms
64 bytes from ec2-13-234-210-38.ap-south-1.compute.amazonaws.com (13.234.210.38): icmp_seq=2 ttl=48 time=19.6 ms

[core@crc-4727w-master-0 etc]$ cat resolv.conf

Generated by CRC

search crc.testing
nameserver 10.88.0.8
nameserver 192.168.130.1
nameserver 8.8.8.8

[core@crc-4727w-master-0 etc]$ ping github.com
PING github.com (13.234.210.38) 56(84) bytes of data.
64 bytes from ec2-13-234-210-38.ap-south-1.compute.amazonaws.com (13.234.210.38): icmp_seq=1 ttl=48 time=403 ms
64 bytes from ec2-13-234-210-38.ap-south-1.compute.amazonaws.com (13.234.210.38): icmp_seq=2 ttl=48 time=32.9 ms

[core@crc-4727w-master-0 etc]$ nslookup github.com
Server: 10.88.0.8
Address: 10.88.0.8#53

Non-authoritative answer:
Name: github.com

Address: 13.234.210.38

B] I tried ping command again after 10 minutes

[core@crc-4727w-master-0 etc]$ nslookup www.github.com
Server: 10.88.0.8
Address: 10.88.0.8#53

Non-authoritative answer:
www.github.com canonical name = github.com.
Name: github.com
Address: 13.234.176.102

[core@crc-4727w-master-0 etc]$ ping www.github.com
PING github.com (13.234.176.102) 56(84) bytes of data.
64 bytes from www.github.com (13.234.176.102): icmp_seq=1 ttl=48 time=15.10 ms

64 bytes from www.github.com (13.234.176.102): icmp_seq=2 ttl=48 time=110 ms

After this Build started working.

Looks like Cache problem. How can I resolve this issue?

regards