> ## Content Index
> Fetch the complete content index at: https://ostreff.info/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to serve multiple search domains from Cisco IOS DHCP server?
- URL: https://ostreff.info/how-to-serve-multiple-search-domains-from-cisco-ios-dhcp-server/
- Published: 2021-01-27T18:48:50.000Z
- Updated: 2021-01-27T18:48:50.000Z
- Author: Jordan Ostreff
- Tags: Cisco

Source - [https://www.perkin.org.uk/](https://www.perkin.org.uk/posts/serving-multiple-dns-search-domains-in-ios-dhcp.html?ref=ostreff.info)

The expected

\[code language="plain"\]ip dhcp pool host.net.example.com  
option 119 ascii net.example.com,example.com\[/code\]

doesn't work. So you need to encode search domains in hex using following example script written in Python:

\[code language="python"\]#!/usr/bin/env python  
import syshexlist = \[\]for domain in sys.argv\[1:\]:  
for part in domain.split("."):  
hexlist.append("%02x" % len(part))  
for c in part:  
hexlist.append(c.encode("hex"))  
hexlist.append("00")print "".join(\[(".%s" % (x) if i and not i % 2 else x) \\  
for i, x in enumerate(hexlist)\])\[/code\]

Execute it:

\[code language="plain"\]$ ./cisco.py net.example.com example.com  
036e.6574.0765.7861.6d70.6c65.0363.6f6d.0007.6578.616d.706c.6503.636f.6d00\[/code\]

So the config in ios must look like:

\[code language="plain"\]ip dhcp pool host.net.example.com  
option 119 hex 036e.6574.0765.7861.6d70.6c65.0363.6f6d.0007.6578.616d.706c.6503.636f.6d00\[/code\]

It's done!