- Domain name is split by dots into individual parts
- Each domain part is prefixed with its length
- Each domain name is separated by NUL octet
- Each following domain name must use DNS domain name compression
Here are some examples for implementation in RouterOS:
One domain in search list
Domain used: onlyone.example.net
/ip dhcp-server option add name=domain-search-list code=119 value="0x07'onlyone'0x07'example'0x03'net'"
Two domains in search list
Domains used: first.example.net, second.example.net
/ip dhcp-server option add name=domain-search-list code=119 value="0x05'first'0x07'example'0x03'net'0x0006'second'0xc006"
The most tricky part in this example is compression usage for the second domain in the list. It is represented by the last 2 octets (0xc006):
- Octet c0 represents 2 left-most bits set to 1. It is a flag for compression pointer.
- Octet 06 represents the pointer itself. It points to the 6th byte of our DHCP option value. This is where length byte of example domain part starts.
Mentioned command adds DHCP option to the list of options for DHCP server. Each option then can be assigned to DHCP network and server will provide it to clients.