如何为我的Web应用程序分配名称而不是IP? [英] How to assign a name instead of IP for my web Application?

查看:86
本文介绍了如何为我的Web应用程序分配名称而不是IP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IIS下部署我的ASP.Net 4.5应用程序并浏览我的应用程序后,URL的格式为:IP:Port。



如何命名?



例如现在的网址是:



http://192.168.11.121:88/default.aspx



我希望它是:



http://example/default.aspx



想法是我不想展示IP,我想给用户一个名字而不是IP。

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.

推荐答案

显然,你不能在你的应用程序本身中做到这一点。考虑一下。它与您可能必须分配到您的应用程序的任何名称完全无关。请参阅:

http://en.wikipedia.org/wiki/Domain_Name_System [< a href =http://en.wikipedia.org/wiki/Domain_Name_Systemtarget =_ blanktitle =New Window> ^ ],

http://en.wikipedia.org/wiki/DNS_server [ ^ ]。



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写道:
contracting1990 wrote:

对于内联网我不需要域名...

For intranet I don't need a domain...

请参阅下面的评论。



请阅读这个问题的答案: http://superuser.com/questions/45789/running- dns-local-for-home-network [ ^ ]。



你可以选择什么在您的网络中使用DNS查阅此列表:

http://en.wikipedia.org/wiki / Comparison_of_DNS_server_software [ ^ ]。



-SA

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


如果您已使用名称部署应用程序,例如MyApplication





比通过它可以访问



192.168.11.121/MyApplication



它会在应用程序中自动检查default.aspx并重定向到它。







编辑:



[ ^ ]



请看看这篇文章,我希望它会b根据您的要求提供帮助。
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.





[^]

Kindly have a look on this article, I hope it will be helpful as per your requirements.


这是可能的解决方案之一。编辑位于C:\ Windows \ System32 \ drivers \ etc(win 7)中的主机文件。在此文件中输入



192.168.11.121:88示例



保存文件。希望它能起作用,因为我之前没有尝试过。我不确定是否支持端口号。
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.


这篇关于如何为我的Web应用程序分配名称而不是IP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆