I have a Linux slackware host acting as a LAN router and DHCP server. That is working mostly fine, but the DHCP clients on the LAN cannot resolve domain names.
On the router/DHCP server I have:
eth0 is the connection to the Internet with a static IP: 220.127.116.11, gateway: 18.104.22.168, nameservers: 22.214.171.124 and 126.96.36.199.
eth1 is the LAN interface with static IP 192.168.1.1, netmask 255.255.255.0. This is also the interface for the DHCP server which is started with: /usr/sbin/dhcpd eth1. I also have /etc/sysctl.conf: net.ivp4.ip_forward = 1
My iptables startup has:
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
With the above configuration other hosts on the LAN can get an IP address and I can connect to these hosts from this router/DHCP-server.
What I cannot do is connect from a LAN host (e.g. 192.168.1.101) to the Internet:
$ ping yahoo.com # this timed out in about 40 seconds
ping: unknown host yahoo.com
$ ping 188.8.131.52 # this did nothing for over 8 minutes, then I gave up
PING 184.108.40.206 (220.127.116.11) 56(84) bytes of data.
the /etc/resolv.conf on 192.168.1.101 is:
# Generated by dhcpcd from eth0
# /etc/resolv.conf.head can replace this line
# /etc/resolv.conf.tail can replace this line
What am I missing?