Click here to Skip to main content
11,927,600 members (45,952 online)
Rate this:
Please Sign up or sign in to vote.
See more: Networking
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 18-Oct-10 6:40am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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?

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.1 | Last Updated 18 Oct 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100