For really high security, how can I add ip addresses of the websites that I want to visit individually? What command should I use?

How could I get ip addresses of the websites without being able to access them? Since I want to deny all outgoing and incoming and only allow the ip of what I visit.

Will I still need to allow allow dns port for example for the whole computer?

Or do I need to use ip tables here? Can you tell me how?

I am using ubuntu.


If you know wich websites you will access, you could block any traffic including to dns port, and maintain the /etc/hosts file with the domain name of the websites and theirs ips.

But if the websites change their ips, you will have to change your hosts file. If you do not wish to do that manually, you could setup a dns server who will only answer for the whitelisted websites.

to only allow the website you want with ufw, you could do:

sudo ufw deny from any to any
sudo ufw allow from any to <ip_of_whitelisted_website>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.