It is very well written and will explain a very simple method of troubleshooting viewing the debug messages in real time using tail. Very simple procedures for building your chat scripts, etc.
You can test DNS by using dig..
Dig
www.anywhere.com
should return ip addresses for the website and show the DNS server near the bottom of the output.
it says : "Could not locate remote server".
Sounds like it might be a default route problem.
Pinging an address on the internet would also verify routing, while bypassing DNS.
Open a terminal and run trafshow or even tcpdump (shows more info), or both in seperate terminals. Look for problems like destination unreachable messages. They will also indicate ipaddresses that are incoming to and outgoing from your machine, and ports they are on, protocal, etc.
Flush ipchains / iptables to see if you are blocked by firewall.
Are you using squid, or any redirects, or proxy server?