Skip to content
Ainar Garipov edited this page Mar 26, 2021 · 11 revisions

AdGuard Home - DHCP Server

AdGuard Home can be used as a DHCP server. This page describes how to do that.

  1. Make sure that you run an OS on which AdGuard Home supports DHCP. We currently don't support DHCP on Windows.
  2. 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 two types of values: hex and ip. Both start with the CODE, which MUST be an integer in the [1, 255] range.

See RFC 2132, sec. 3.

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 and 1.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 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 using the dns.autohost_tld field in the configuration file.