I am new to android and doing a demo app for gcm push notification.
I have developed all this code and GCM push notification is coming on devices in my environment, but
Try to ping google.com from your server. If it is not success try to investigate your server configuration.
E.g. Check you /etc/resolv.conf and see if you have:
nameserver 8.8.8.8 nameserver 8.8.4.4