Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have written code that runs in client-server mode. The client sends a query to the server, and the server responds back. I am using Named Pipes.

This works great and without issue, but only if I know the name of the server ahead of time.

Rather than (a)entering the name of the server on every client or (b)sending an expensive query to every computer on the network looking for the server name that is running the Named Pipe, I would like to somehow use DNS. I assume I need an SRV record on the DNS server so the clients can just query the DNS server for a particular service and get the name of the server in return.

Can someone help or point to an article on how to do this? I cannot find any articles that show how to do this.

Thank you!
Posted

First, read this[^] to find out how an SRV (Service) record works. It's surprisingly simple.

Your app then just has to lookup the service name in DNS and it'll get back the IP information to connect to.
 
Share this answer
 
Thanks, so I see I can use nslookup or the Win API DnsQuery.

Now, how do I programatically add an SRV record to the DNS server?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900