Pihole on Ubuntu Server in Virtualbox VM

For anyone else out there struggling I did the following to fix it:

  1. Changed my Virtual box network card setting to NAT
  2. Configured to forward the ports 80:80 (TCP), 443:443 (TCP) 53:53 (UDP/TCP) and 67:67 (UDP)
  3. Reconfigured my Pihole install on the Linux Ubuntu server with pihole -r
  4. Changed the network config to a static ip and set the server IP to the IP address of the host machine NOT the VM. E.g. 192.167.1.155 and set the gateway to 127.0.0.1 .

I'm not sure entirely why this works but it does.

I think because with NAT it's forwarding the ports from the host machine to the VM so any requests go sent to that VM virtual network. Then when it's sending stuff back it sends it to local host then the NAT forwards it the other way again. (I might be wrong though). I'm new and learning Linux, Networking Etc. as I go.