This isn't a PHP problem, but rather a system administration problem. Ordinarily your machine should know about DNS by being properly configured, either explicitly or through DHCP. You could try placing the address of a valid DNS server in /etc/resolv.conf.