How to add a hostname alias

We have a server application that we install on our customers' networks. It uses the Winsock2 API to listen for and respond to requests from a client application. Is there a way (programmatically or manually) to add a hostname alias for the computer that is running the server application? Then if the server application is moved to another machine the alias hostname can be moved with it and the client software configuration wouldn't need to be touched. The server application runs on Win XP and Win 2003 Server.
andrewzimAsked:
Who is Participating?
 
Steve KnightIT ConsultancyCommented:
Another option is actually going the other way and means you don't need name resolution -- if your app can use an IP address then obtain an extra static IP address and assign a secondary address to the machine the app. runs on with that IP and set your app. to bind to the extra I (or all IP's).  To move machine you remove the secondary IP and move it.   Downtime is really short -- length of ARP cache on workstations, maybe 1 min as opposed to a DNS entry etc. which could be kept in use out of date pointing at the wrong IP for a while until it's TTL runs out.

Steve
0
 
SilentezCommented:
You can try to add static alias for server to DNS server in customers' networks.
BTW, why it's just not use netbios name resolving?
0
 
andrewzimAuthor Commented:
Most of the networks don't have a DNS server, so they're already using netbios name resolution for the computer names. But the question still remains, how can we add an alias that can be moved with the server application? We want to leave the computer name unchanged for the other resources on the machine. What am I missing?

Interestingly enough, this is quite simple on the public internet with dynamic domain services, such as no-ip.org. Is there an equivalent for LAN's?

I'm changing this to 1000 points.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
andrewzimAuthor Commented:
Sorry, I see I can't go over 500 points.
0
 
SilentezCommented:
Oh, I see... Hmm... for hostnames you can use hosts file, but it must be manually configured on each machine... :(
0
 
Steve KnightIT ConsultancyCommented:
Do they use WINS on the site by any chance that you could add?  Unless it is a tiny company with one subnet they will have either WINS or DNS.

As to getting your application to work over this it depends ... to get a server to accept \\anothername you have to adjust a paramater under HKLM\services\current control set\services\lanman .... can't find the key at the moment, will find it if you need it.  If you are just talking about a TCP connection and just need the name resolving to Ip then WINS, DNS, HOSTS table are your options.

Steve
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.