0

Is there a way to block specific hostnames from being accessible in Virtualbox guests?

For example, I want to block all access to superuser.com or stackoverflow.com in the OS running in a Virtualbox VM, or maybe point those hostnames to 127.0.0.1 or a dummy address. What's the best way to accomplish this?

1
  • Please register your account fully. Use this link if it's necessary. After you regain control over your question, accept the answer instead of posting "thank you". Take our tour to see how the site works. Commented May 3, 2018 at 14:50

1 Answer 1

1

Is there a way to block specific hostnames from being accessible in Virtualbox guests?

All the normal methods of blocking websites for physical machines are possible with VirtualBox guests as well. You can:

  • Modify the guest's hosts file and direct the given requests to the IP(s) of your choice there.

  • Set up a local DNS server and route the guest's DNS requests to that server (which, again, would resolve those certain requests to any IP(s) of your choice.)

  • Set up a proxy server to block requests to those addresses from the guest.

Regarding the DNS and proxy server solutions, either of these servers could be on the guest itself, another virtual machine, the host or another physical machine on the network.


It is probably worth mentioning that you don't need to give guests Internet access in the first place — you can use Host-Only network adapters, for instance.


What's the best way to accomplish this?

For minimal security, solutions that rely on the guest machine are probably less secure than those that rely on a separate virtual machine, the host or another physical machine.

Other than that, the best solution probably depends greatly on your network and why/how you wish to block those addresses.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .