I am trying to turn a router on an offline LAN into 'whole of Internet' such that accessing any domain from a machine on the LAN would hit the webserver on the router.
For this purpose, I decided to make a test using two virtual machines using VirtualBox and an internal network with two Debian boxes (let's call them A and B) hooked to each other. Under normal circumstances, the router would not have an Internet connection.
Box A has two interfaces: eth0 and eth1. eth0 is only used to download packages and such. Box B only has eht0 which is connected to the internal network between the two boxes.
On box A, I set up a DHCP server which provides a nameserver IP address that matches its own. It also has an apache HTTP server running. Finally I started dnsspoof on box A using the following command:
Using dig, I can see that queries for domains like example.com or google.com all return the IP address of the box A as A record. However, when I try to ping or curl any of those domains, I get a 'could not resolve hostname' error.
Can someone please explain what I am doing wrong?