host/network www.google.com not found
Presumably you're doing this either before configuring DNS, or while your firewall configuration is blocking DNS.
In any case, you're using the wrong tool for the job. You're trying to drive in a screw with a hammer. Even if you manage to get something done, I wouldn't sit on that chair.
For this example, it won't work:
www.google.com has many IP addresses, and a given DNS lookup returns only a few of them. You can't easily enumerate all the IP addresses of
www.google.com. So your requests to
www.google.com will randomly get through or not. Conversely, many sites that are smaller than Google operate out of the same IP address, so you could only block all or none of them.
In order to filter web access, you need a web proxy. In the itables configuration, block all outgoing access except for port 443 (you pretty much can't filter HTTPS anyway, except in an invasive and insecure way which I will not go into in this answer) and except for the user running the proxy.
iptables -P OUTPUT DROP
iptables -A OUTPUT -p icmp -j ACCEPT
iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT
iptables -A OUTPUT -p tcp -m owner --uid-owner wwwproxy -j ACCEPT
wwwproxy by the name of the user running the HTTP proxy, which will depend on your proxy configuration.
There are many HTTP proxies out there. Squid is popular, but for a small installation you might prefer something smaller.