Using Hyper-V I built a private windows domain which is fenced off from our main network. Ultimately I want to provision this domain for others to use for dev and test, so they can be domain admin.
The domain controller is running the dhcp service (other systems in my domain have dependencies on dhcp). The problem is, if some idiot (i.e. me) accidently connects the domain controller to the main network it will respond to dhcp requests (this is an assumption) and hand out invalid ip configurations.
So, I would like to write a .NET windows service which starts the local dhcp service only when no other dhcp servers are available. Ideally, this would be capable of periodically checking in the background, so if you change your virtual network config while the machine is running, dhcp can be stopped automatically and potential damage is limited.
I'm a bit stuck on how to detect remote dhcp servers. So far I have considered writing a wrapper for the dhcploc command line tool, but is there is a better/simpler alternative that would acheive the objective? Are there any caveats I should be aware of?
Thanks