Well, one thing to look at, since you are getting nameserver complaints, is /etc/resolv.conf
That file should contain
where, or course, w.x.y.z is the IP of your nameserver (or gateway). I just replace or comment whatever default stuff is there with what I want, using what's there as a model.
You might also try (and I think this may depend on distro... :
You will need to see your wlan0 interface and your router's address mentioned in the results.
If you don't say:
# route add default gw w.x.y.z
where w.x.y.z is the IP of your router/gateway.
Now you should be able to ping the gateway, and anyplace else on the Internet that will echo!
PS: maybe you know this, forgive me if you do, but $ means user is okay, # means root required.