Whether you use a standalone DHCP server
A standalone DHCP server typically starts "empty" – you have to configure it for the address pools to offer and you have to configure it for the DHCP lease options to include along with the address. ("DNS servers" is option 6, it's often accompanied by "Domain suffix" option 15.)
For example, the widely used ISC DHCP Server dhcpd
on Linux would be configured like this:
subnet 10.147.112.0 netmask 255.255.255.0 {
range 10.147.112.2 10.147.112.254;
option routers 10.147.112.1;
option domain-name-servers 10.147.10.53;
option domain-name "internal.example.org";
}
(Note how even the "default gateway" has to be specified explicitly!)
The dnsmasq
DHCP server is tailored for home use (and sometimes found inside SOHO routers) and can automatically offer the DNS servers that the host OS is configured to use (by reading /etc/resolv.conf), though they can also be listed explicitly:
dhcp-range = 10.147.112.2, 10.147.112.254, 255.255.255.0
dhcp-option = option:domain-name, lan.example.org
dhcp-option = option:dns-server, 10.147.10.53
But as the name suggests, DNS server IP addresses technically are optional information and an address lease could be issued without them – e.g. if setting up an isolated network that doesn't need DNS, you could just not send option 6 in the DHCP leases at all.
Also note that the DNS server information does not have to be obtained from the ISP – any public DNS server has the same access to domain information as any other public DNS server, so you could choose to use a third-party resolver (such as Google's 8.8.8.8) or even run one yourself.
In the (real) examples above, 10.147.10.53 is a local DNS server running ISC BIND (in another subnet of the same network) which resolves domain names without any help from the ISP's resolvers, or any other resolvers for that matter – it directly talks to the authoritative servers of each domain.
Resolving a domain name involves chasing referrals (pointers to another server) starting from the "DNS root" nameservers. The list of root servers changes extremely rarely and most DNS "recursive resolver" software just have the list built-in, meaning that they do the job without needing to detect or provide any server information at all.
So even if you don't know any DNS server addresses to use, all you need is to install any recursive resolver software such as Unbound or ISC BIND on the same system (and make the DHCP server advertise its local IP address) – and you have fully working DNS service.