The topic is old but I spent a lot of time to solve the problem that appeared in me.
Check the /etc/resolv.conf file.
If localhost (127.0.0.1) is not in the first place then change that.
If you are already using dynamic addition to resolv.conf, the default option on server providers, then...