This morning for the second day in a row, PHP on my server was unable to resolve the hostname to a IP via file_get_contents('http://newswebsite.com/feed.rss'), and service restart apache2 resolved the issue, but this was never an issue anyway.

There doesn't seem to be any errors in the apache logs. Are there any other places I can check for a misconfiguration or error logging ?

OS information

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.150519
Release:        14.04
Codename:       trusty

Apache 2 version

Server version: Apache/2.4.7 (Ubuntu)
Server built:   Jul 15 2016 15:34:04

PHP Version

PHP 5.5.9-1ubuntu4.21 (cli) (built: Feb  9 2017 20:54:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

IP Configuration

auto eth0
iface eth0 inet static
        address xx.xx.xx.106/27
        gateway xx.xx.xx.97

iface eth0 inet6 static
        address xx:xx:xx:xx::100:1
        netmask 64
        gateway xx::xx:xx:xx:1
        dns-nameservers 2001:4860:4860::8888 2001:4860:4860::8844

/etc/hosts       localhost        lo       websrvA01


  • 1
    The /var/log directory contains all sorts of logs. Some of them may even be relevant. – Iain Mar 22 '17 at 8:05
  • Could be related to this question: serverfault.com/questions/839659/… – Gerald Schneider Mar 22 '17 at 8:08
  • how does you /etc/hosts and /etc/hostname look like? – Orphans Mar 22 '17 at 8:17
  • Added hosts and hostname to my question. – Sander Mar 22 '17 at 8:21
  • Apache does not do name resolutions of any kind and you are refering to a PHP function, so why do you look at Apache when you should look to PHP? – ezra-s Mar 22 '17 at 9:59

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.