DHCP options are the type-length-value fields carried in DHCP messages that deliver every configuration parameter beyond the IP address itself, such as the subnet mask, default gateway, DNS servers, lease time and boot server. In address configuration within networking, options are what turn a bare address assignment into a complete, working network setup for a client.
The option format is inherited from BOOTP and is defined for IPv4 in RFC 2132, with many later RFCs adding new codes. A familiar example is DHCP option 66, which tells IP phones and network-booting devices the name of the TFTP server holding their configuration or boot image.
How DHCP options are encoded
Every DHCPv4 message has a fixed header followed by a variable options field. The field begins with the magic cookie 99.130.83.99, which identifies the content as DHCP options rather than legacy BOOTP vendor data. Each option then consists of a one-byte code, a one-byte length and the value itself, so a single option can carry at most 255 bytes of data.
Two codes are special: code 0 (Pad) is used for alignment and has no length byte, and code 255 (End) marks the end of the list. When a value is longer than 255 bytes, RFC 3396 allows it to be split across several instances of the same option, which the client concatenates. If the options field itself runs out of space, option 52 (Option Overload) lets the server reuse the legacy sname and file header fields for additional options.
Clients state what they want through option 55, the Parameter Request List, a list of codes the client is prepared to use. Servers generally return the requested options that are configured for the scope, plus a small set of mandatory ones, and should not send options the client did not ask for unless policy requires it.
The most important option codes
A few dozen options cover nearly all deployments. The table below lists the codes that administrators meet most often and the value format each one carries.
| Code | Name | Value format | Typical use |
|---|---|---|---|
| 1 | Subnet mask | IPv4 mask | Defines the local network size |
| 3 | Router | List of IPv4 addresses | Default gateway |
| 6 | Domain name server | List of IPv4 addresses | DNS resolvers |
| 15 | Domain name | Text string | Default DNS suffix |
| 42 | NTP servers | List of IPv4 addresses | Time synchronization |
| 51 | IP address lease time | 32-bit seconds | Lease duration |
| 53 | DHCP message type | One byte | Identifies DISCOVER, OFFER and others |
| 66 | TFTP server name | Text string | Phone and boot provisioning |
| 67 | Bootfile name | Text string | PXE boot image path |
| 82 | Relay agent information | Sub-options | Switch port and circuit identification |
| 121 | Classless static route | Prefix and gateway pairs | Additional routes |
Some options are protocol control fields rather than configuration. Option 53 identifies the message type, option 50 carries a requested address, option 54 identifies the server, and option 61 supplies a client identifier that may be used instead of the MAC address to match a DHCP reservation.
Option scopes, classes and precedence
DHCP servers let administrators define options at several levels, and the most specific level wins. This hierarchy keeps common settings in one place while still allowing exceptions for a single subnet or device.
| Level | Applies to | Example setting |
|---|---|---|
| Server or global | All scopes on the server | Company DNS servers and domain name |
| Scope or subnet | One DHCP scope | Default gateway for that VLAN |
| Class or policy | Clients matching a vendor or user class | Boot file for one device family |
| Reservation | One specific client | Unique NTP or TFTP server |
Classes are matched using identifiers that clients send. Option 60, the Vendor Class Identifier, lets a server recognize device families such as PXE clients or a particular phone model. Option 43, Vendor-Specific Information, then returns data whose internal structure is defined by the vendor; wireless access points, for example, often use it to locate their controller. Option 77 carries a user class, which administrators can set on clients to group them by role.
DHCP options in IPv6 and relayed networks
DHCPv6 uses a different option space, with two-byte codes and two-byte lengths, defined in RFC 8415. Codes do not map one to one: DNS servers are option 23 and the domain search list is option 24. There is no default gateway option in DHCPv6, because IPv6 hosts learn their routers from router advertisements.
The comparison below summarizes the main differences an administrator must keep in mind when running both protocols.
| Aspect | DHCPv4 | DHCPv6 |
|---|---|---|
| Code and length size | 1 byte each | 2 bytes each |
| Maximum single value | 255 bytes without splitting | 65,535 bytes |
| Default gateway | Option 3 | Not provided, router advertisements used |
| DNS servers | Option 6 | Option 23 |
| Relay information | Option 82 | Interface-ID and Remote-ID options |
In relayed networks, a DHCP relay forwards client broadcasts to a central server. The relay can insert option 82 with sub-options such as Circuit ID and Remote ID, which identify the switch port or line the request came from. Servers use this information for port-based address policies, and the relay strips option 82 before passing the reply back to the client.
Common mistakes and troubleshooting
Most DHCP option problems produce clients that receive an address but still cannot work correctly. The table maps frequent symptoms to their usual causes.
| Symptom | Likely cause | Fix |
|---|---|---|
| Address received but no internet | Option 3 missing or wrong | Set the correct gateway on the scope |
| Names do not resolve | Option 6 points to unreachable servers | Correct the DNS server list |
| Phones fail to provision | Option 66 holds a wrong name or IP | Verify the TFTP server value and reachability |
| PXE boot loads wrong image | Option 67 not matched to client architecture | Use class-based policies for BIOS and UEFI |
| Static routes ignored | Option 121 sent alongside option 3 incorrectly | Include the default route inside option 121 |
A subtle rule in RFC 3442 states that when a client receives option 121, it must ignore option 3, so the default route has to be listed inside option 121 itself. Another frequent error is sending an option with the wrong data type, such as an IP address where a text name is expected; many phones treat option 66 as text, while some firmware accepts only an address. Packet captures of the DHCP exchange remain the fastest way to see what the server actually sent.
The idea in brief
When a device joins a network, it needs more than an address. It must know where the exit to the internet is. It must know which server translates names into addresses. Some devices also need to know where to fetch their settings.
DHCP options are the extra notes attached to the address. Think of a hotel key card that comes with a small leaflet. The leaflet lists the Wi-Fi, breakfast hours and the reception number. The key gets you in, and the options tell you how to use the place.
A practical scenario
An office of 300 people moves to a new building with a voice VLAN for 120 desk phones. The network team creates a scope of 10.20.30.0/24 with option 3 set to the VLAN gateway 10.20.30.1, option 6 pointing to two internal DNS servers and a lease time of eight hours in option 51.
On first boot, the phones obtain addresses but show a provisioning error. A packet capture reveals that option 66 is absent, because it was configured only on the data VLAN scope. The team adds option 66 with the provisioning server name to the voice scope and uses a vendor class policy based on option 60 so that only phones receive it.
After the phones are restarted, all of them download their configuration within minutes. The outcome is fully automated provisioning with no manual settings on any handset, and future phones of the same model will configure themselves the moment they are plugged in.