Things, I would try first:
- example.com? - is the returned IP the correct one? Set manually to see if that helps?
- Check if router filters on MAC...
(update:) If the router does not forward IP packets from an unregistered source (the MAC of your PCs card/dongle),
the request will not reach the server - this is a simple (but not very effective) security measure.
- Check if local hosts interface(s) is reachable from server (routing).
(update:) If the server is multi-homed and the routing is not configured right, the response might travel through the wrong (default-)network.
- Snoop at server side, analyse traffic with wireshark. (updated)
- Use i.e. perltidy to make code easier to parse for humans ;-)