Here is a guide to fix your iPhone/iPod Touch wifi if it doesn’t work. This guide is made by Danls92.
Many people complain that they get an error saying: “Safari can’t open the page because it can’t find the server,” although they have full signal. This is a common problem, caused by the way iPod handles the Domain Name System (DNS).
To test if this is your problem, enter this into the address bar: 188.8.131.52
It should load Google. The reason that this works is because DNS is what converts the URL (what you enter into the address bar) into the correct IP address. By directly entering the IP address, you eliminate the need for the DNS.
Here is how you fix this:
1) On the Springboard, go to Settings> Wifi
2) Tap the blue arrow to the right of the network’s signal strength meter
3) Delete everything in the DNS field
4) Copy everything in the Router field to the DNS field so it looks like this:
Now go into Safari, and try to load a page. It should work!
If that doesn’t work, and you are at somewhere other than a home or personal network, there is a good chance that there is MAC address filtering. A MAC address identifies the device to the network and if there is a filter, only specific devices will be allowed to connect.