Hi
I am looking for a way to automatically redirect all outbound DNS queries from a particular Guest OS to a DNS server on my Host OS. Here is my current setup:
Host OS: CentOS 5.3
Guest OS: Windows XP
Networking Type: Bridged
Right now my Guest OS can access the Host OS just fine. I can browse the internet and do whatever I want from both. My host OS has the IP address 192.168.1.110 and my Guest OS has the IP 192.168.1.151. I have the following iptables rule on the Host OS:
iptables -t nat -I PREROUTING -s 192.168.1.151 -p tcp --dport 53 -j DNAT --to-destination 192.168.1.110
However, I think PREROUTING might not be used since it's actually on the same physical computer. Now how can I get this to work? Also keep in mind I want the Guest OS to still be able to get to the Internet or the LAN at the same time. I do not want it to be restricted to some internal-only network.
You might be thinking just point he DNS server settings on the XP machine to 192.168.1.110. That would work if it weren't for others applications and things running on the system that use pre-configured outside DNS servers. I want to just capture the outbound queries and send them to my local DNS server on the host OS which responds with the same IP for all queries. I DO NOT want to have some sort of upstream firewall or other device do this. I never want the traffic to leave the machine. I know this can be done, but how?! Is there some trick with Host Only networking I can do or perhaps the FORWARD or some other part of iptables -- but just for DNS outbound from this particular Guest IP? Any help with this would be appreciated. Thanks in advance.