I just added cloudfare to my website and website started showing weird errors after that which are automatically solved after refreshing the page 3-4 times. But after surfing the website, the same error gets showing in some other web page. This is the error:
Warning: mysqli_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in public_html/phpConfigs/DBConfig.php on line 8 Warning: mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in public_html/phpConfigs/DBConfig.php on line 8
This might sound like a programming related question but i asked this on stackoverflow too, people there said that its cause of DNS misconfiguration and its a question for serverfault. After looking in the "DNS" section in my cloudfare dashboard, first question is how do i check if it really is the DNS issue? If it is a DNS issue how do i know what is the issue and how to fix it?
Considering the error automatically gets solved after refreshing the page is so confusing, ive seen this type of mis-behave in a website for the first time, either it should always work, or never work.. I am sorry in advance if i said some illogical things, i am pretty new to networking. Any sort of help is very appreciated.