As I blogged earlier, I purchased an iPhone in late January. While setting it up, I ran into an issue with the WiFi. The problem was that while the iPhone could see my network and it could ping other devices on my network, it could not access the internet via my router.
As it turns out the issue was related to my DNS setup on the iPhone. By default the iPhone had registered the IP address of my router (or gateway, if you will) in addition to the DNS entries I had listed DSL modem configuration. I decided to remove all of the entries, except for my router's IP.
Ba-da-bing, ba-da-bam! That did the trick. All of a sudden I was merrily surfing over my WiFi connection. It's been smooth sailing since then.
I have ran into the same issue at some open WiFi spots around town as well. So keep this quick solution in mind.