Hi all
I've been building a DHCP server and router using iptables and isc-dhcp-server on Debian 8. I'm definitely slowly getting there, but I've hit another snag regarding DNS/DHCP.
I own a domain, lets call it beans.com. I've not set it up properly yet and at the moment it resolves to, lets call it 5.5.5.5 for simplicity.
My dhcpd.conf file looks like this (with some of the commented lines removed):
Code:
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;
# option definitions common to all supported networks...
option domain-name "beans.com";
option domain-name-servers 194.168.4.100,194.168.8.100;
# ^ Note - these are my ISPs DNS servers
default-lease-time 86400;
max-lease-time 604800;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
#subnet 10.152.187.0 netmask 255.255.255.0 {
#}
# This is a very basic subnet declaration.
subnet 192.168.27.0 netmask 255.255.255.0 {
range 192.168.27.101 192.168.27.199;
option routers 192.168.27.70;
}
This is handing out IP addresses perfectly. I have a windows machine called BEAR and another called TEST. Both are running on 192.168.100 addresses dished out by this DHCP.
When I ping ANY hostname from these PCs, it pings thing.beans.com which resolves to 5.5.5.5. Even if I ping a host which doesn't exist.
Ultimately I want to be able to ping server.beans.com and mail.beans.com and baked.beans.com from the web and hit different servers in my house. But I also want to be able to ping BEAR from TEST and have it resolve to 192.168.x.x.
I'm guessing I need my router/DHCP to also be a DNS server which resolves local addresses and forwards remote addresses. I'm looking up BIND now but if there's a simpler way of doing this or a problem with my DHCP setup, I'd appreciate your advice.
Thanks!