Can't access DNS from PC using NAT/masq
I have a computer running linux (self compiled 2.6.9 on top of RedHat 9) that
is connected to the internet via DSL. I want to also be able to use the
internet connection from a PC running Windows XP. I have set up a
network between the two and, following the IP MASQUERADE howto,
entered the following commands:
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/ip_dynaddr
Now I can ping the IP addresses of computers on the internet from the Windows
PC. In particular, I can ping my ISP's namesevers without any problem by pinging
their IP addresses.
However, the Windows PC cannot get any DNS service at all. I can't ping any
name and when I try nslookup on the Windows PC I get the message:
*** Can't find server name for address a.b.c.d no response from server
*** Can't find server name for address e.f.g.h no response from server
*** Default servers are not available
Default Server: UnKnown
Address: a.b.c.d
The addresses a.b.c.d and e.f.g.h are exactly the same addresses as in my linux
computer's /etc/resolv.conf file and there is no problem with using DNS from the
linux computer.
In case it's interesting, here's the output from "iptables -t nat -L -nvx"
Chain PREROUTING (policy ACCEPT 1013 packets, 76759 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 306 packets, 18430 bytes)
pkts bytes target prot opt in out source destination
106 6403 MASQUERADE all -- * ppp0 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 408 packets, 24593 bytes)
pkts bytes target prot opt in out source destination
Any ideas?
|