Powershell and DHCP Domain Search Suffix Order

Hey there. The Finn is back after a long time, this time with a Domain Search Suffix Order issue. I ran into this issue at my new place of work where we have multiple platforms like Windows 10, MacOs and even Linux together with multiple domain names.
Traditionally you would just use a group policy to set the search lists on domain joined boxes. Problem solved, well not here because Linux and MacOs don’t do GPO’s. This pushed me to find an alternative that works cross-platform as well. Welcome to the DHCP option 119.
Windows Server DHCP does not include that option out-of-the-box, so you’ll have to add that manually prior to running the script.
Run dhcp mmc, right click on IPv4 under Servername and select “Set predefined options…”
Click Add, give it a descriptive name. Click on the “Array” checkbox, type in 119 in the Code-field and finish with “OK”.
Now you are ready to run my script below. Kudos to the original author for the hex-conversion. Made my day a lot easier. Why reinvent something that works?
My additions just gets all of your existing scopes and adds the 119 option values. Or you can also do a single scope at a time if needed. Remember to replicate your scopes if you are running in DHCP-failover mode since that is not done automatically.
Now all of your supported devices should work with this option. Not all OS’es actually request this option so your mileage might wary. Windows 10 as of 1809 should be fine. MacOs 10.6 (if memory serves) and Ubuntu from ages ago.
I hope you liked this post and got some use out of it. I am not sure how common this issue is but here is a verified solution for problem with distributing the Domain suffix search list to devices other than Windows.
set-option-119 rename to .ps1
1 reply

Trackbacks & Pingbacks

  1. […] Powershell and DHCP Domain Search Suffix Order via Toni Holopainen […]

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *