Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
1.57/5 (3 votes)
After deploying my ASP.Net 4.5 application under IIS and browse my application the URL is in format: IP:Port.

How to give it a name?

For example the url now is:

http://192.168.11.121:88/default.aspx

And I want it to be:

http://example/default.aspx

The Idea is I don't want to show the IP, I want to give the user a name instead of IP.
Posted
Updated 20-Oct-13 21:24pm
v4

Apparently, you cannot do it in your application itself. Just think about it. And it it totally irrelevant to any names you may have to "assign" to your application. Please see:
http://en.wikipedia.org/wiki/Domain_Name_System[^],
http://en.wikipedia.org/wiki/DNS_server[^].

contracting1990 wrote:
For intranet I don't need a domain...
Please see my comment below.

Please read the answers to this question: http://superuser.com/questions/45789/running-dns-locally-for-home-network[^].

You can choose what to use for DNS in your network consulting this list:
http://en.wikipedia.org/wiki/Comparison_of_DNS_server_software[^].

—SA
 
Share this answer
 
v2
Comments
[no name] 21-Oct-13 3:39am    
So no other way to show name instead of ID:Port?
Sergey Alexandrovich Kryukov 21-Oct-13 10:23am    
It's now "show". The user types the URL in the address bar, and anchors use it. Normally, people buy domain names, pay the annual fee, and the owner of the hosting add data to DNS server data, and then it is propagated...
—SA
[no name] 21-Oct-13 10:26am    
For intranet I don't need a domain...
Sergey Alexandrovich Kryukov 21-Oct-13 10:35am    
Great. Then you need your own, internal, Intranet DNS...
Just think about it: a Web site cannot define its own URL, because — how another side would "know" about it?
—SA
[no name] 22-Oct-13 1:31am    
Good point
If you have deployed your application with the name for example "MyApplication"


Than it can be accessed through

192.168.11.121/MyApplication

it will check for the default.aspx automatically in the application and will redirect to it.



EDIT:

[^]

Kindly have a look on this article, I hope it will be helpful as per your requirements.
 
Share this answer
 
v2
Comments
[no name] 21-Oct-13 3:13am    
I don't want to show the IP, I want to give the user a name instead of IP.
VICK 21-Oct-13 4:32am    
Than get some domain or get SSL certificate to redirect like

portal.myapplication.com

Etc...
[no name] 21-Oct-13 5:09am    
I want to do it on local network to be used as intranet
VICK 21-Oct-13 5:15am    
Solution Edited.. Kindly check the link.
[no name] 21-Oct-13 6:27am    
Thanks it works. My 5
This is one of the possible solution. Edit a host file which is located in C:\Windows\System32\drivers\etc (win 7). Make an entry in this file as

192.168.11.121:88 example

save the file. Hope it works as I have not tried it myself before. I am not sure if the port number is supported.
 
Share this answer
 
Comments
[no name] 21-Oct-13 3:20am    
But this I have to do it on every machine. not a good idea when its a web application
bbirajdar 21-Oct-13 5:22am    
Buy a domain name..It costs only about 10 USD..or the cost of a keyboard of one of the computer in your organisation...
[no name] 21-Oct-13 6:29am    
Thanks for hint but I was aiming for intranet so don't need a domain. solution 1 works fine after Edit.
ArunRajendra 21-Oct-13 6:57am    
Thanks

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