tags:

views:

25

answers:

1

HI i want to find IP's of all dhcp servers available on the lan using c#. Any Idea?

A: 

Use the DHCP Server Management API http://msdn.microsoft.com/en-us/library/aa363376%28VS.85%29.aspx

The bad thing is that it's native win32 so you have to pinkvoke it.

Bogdan
Thanks for you reply but these apis works only if i am a member the domain otherwise it does not work i want to discover the DHCP servers weather i am on domain or on workgroup
Ehtsham
Then you have to create a custom packet and UDP broadcast it, as per RFC http://tools.ietf.org/html/rfc2131 and http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol#DHCP_discovery
Bogdan
@Bogdan - yes what i am asking about how can i create a dhcp request/discovery packet and send it any sinnepet
Ehtsham