-
Notifications
You must be signed in to change notification settings - Fork 2.1k
DHCP
AdGuard Home can be used as a DHCP server. This page describes how to do that.
-
Make sure that you run an OS on which AdGuard Home supports DHCP. We currently don't support DHCP on Windows.
-
Make sure that your machine has a static IP address.
By default, AdGuard Home will set itself as the DNS server for the DHCP clients. The default lease time is 24 hours.
See the DHCP section in the configuration article for the overview of the DHCP configuration options. There are several configuration parameters for DHCP that can't be set via the AdGuard Home administrator dashboard. Those are described below.
The options
field accepts four types of values: hex
, ip
, ips
, and
text
. They all start with the CODE
, which MUST be an integer in the [1,
255] range. See also RFC 2132, sec. 3.
In accordance with RFC 2131, sec. 4.3.1, these options override the
default options' values set by Adguard Home and requested by a client. Which
means that if you want to set DNS server addresses using option 6
, you should
also add Adguard Home's own addresses there. Otherwise, AdGuard Home's
filtering won't work for the DHCP clients who receive these DNS server
addresses.
Option del
has been added in v0.107.12. It is used to unconditionally
remove options from the server's responses, which may lead to weird behaviors.
Use with caution. On example where this option is useful is when a client
doesn't accept a lease because of an option, see issue 4337.
-
The
hex
format is:CODE hex HEX_VALUE
For example, to set option
6
, the DNS server, to two IP addresses,1.2.3.4
and1.2.3.5
, use:# … 'dhcp': # … 'dhcpv4': # … 'options': - '6 hex 0102030401020305'
-
The
ip
format is:CODE ip IPV4_VALUE
For example, to set option
6
, the DNS server, to one IP address,1.2.3.4
, use:# … 'dhcp': # … 'dhcpv4': # … 'options': - '6 ip 1.2.3.4'
-
The
ips
format (since v0.106.0) is the same, but with comma-separated IP-addresses:# … 'dhcp': # … 'dhcpv4': # … 'options': - '6 ips 1.2.3.4,5.6.7.8'
-
The
text
format (since v0.106.0) allows you to put arbitrary UTF-8 text as the option data. For example:# … 'dhcp': # … 'dhcpv4': # … 'options': - '252 text http://example.com'
-
The
del
format (since v0.107.12) allows you to remove an option. For example:# … 'dhcp': # … 'dhcpv4': # … 'options': - '61 del'
The option dhcp.dhcpv6.ra_slaac_only
, if true
, sends RA packets forcing the
clients to use SLAAC. The DHCPv6 server won't be started in this case.
The option dhcp.dhcpv6.ra_allow_slaac
, if true
, sends RA packets allowing
the clients to choose between SLAAC and DHCPv6.
Machines in the network can be reached more easily using the hostnames they send
in the DHCP requests with a configurable top-level domain (TLD). By default,
the TLD is lan
. For example, if you have a machine called “workstation” in
the network, and it sends a DHCP request with option 12 set to workstation
,
you can reach it over HTTP on the host http://workstation.lan
.
You can also set a custom TLD or domain name using the dns.local_domain_name
field in the configuration file.