Safari can't open the page because the server can't be found on iPhone 4s?

At first, the internet worked, but then just stopped. I can go on google a and search something, but when I try to go on some site, I have that error. I have Wi-Fi and I do not have a SIM on my iPhone, so I can't go on Settins/Cellular. Are there any solutions?

Restore your Safari on your i phone then check

This clearly sounds like a DNS problem.

Try this:
http://www.macinstruct.com/node/558

(Use Google's DNS servers in step 5)