This happens because of the varying way in which iOS handles DNS requests.
To resolve this, go to Settings, Wi-Fi, <Your Wi-Fi Name>, DHCP and change the value of DNS to 208.67.222.222 which is OpenDNS service IP address. This will resolve the server not found error.