We recently had an incident that Jira box could not resolve DNS properly after rebooting. The related errors in the logs are java.net.UnknownHostException.
We run Jira as a container under the account named Jira. So I logged into the container as root to check the DNS settings. The settings look fine, and I can either ping or nslookup the host. But once I changed to Jira account and tried ping again, I got the error: Name or service not known. Aha, it does not sound right. So I checked the permission of the resolv.conf file. It shows only root can read the file:
-rw——- 1 root root 340 Aug 7 11:23 /etc/resolv.conf
Not sure why and how the permission has been changed, and there is no way for me to track it down as we don’t audit the file permission change. Once I changed the permission to readable for everyone, , then I was able to ping the host.
chmod 644 /etc/resolv.conf
But Jira was still unable to resolve DNS. The reason of that is the process only loads the resolv.conf file once when it starts. So after the change of permission, it requires a reboot of the process or container to make the change take effect.