为什么在IIS中添加URL之前需要在DNS中注册网站? [英] Why do we need to register a website in DNS before we add the URL in IIS ?

查看:132
本文介绍了为什么在IIS中添加URL之前需要在DNS中注册网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ASP.NET中创建了一个应用程序,并在IIS中发布了代码.但是,在输入网站的URL时,该应用程序未打开.

我发现我需要在DNS中注册URL.
我的问题是:
当我们在DNS中注册URL时会发生什么?

I created an application in ASP.NET and published the code in IIS. However on entering the URL for the website, the application did not open.

I found out that I need to register the URL in DNS.
My question is:
What happens when we register the URL in DNS?

推荐答案

它将为您的URL创建一个映射,以便将其解析为您的服务器.可以将其视为键值字典,其中key是您的网址,例如myawesomesite.com,其值将是例如123.456.789.21.因此,当您浏览至myawesomesite.com时,该地址将在内部被解析为服务器的相应IP地址.这样做是为了使您的服务器可以轻松地在Internet上进行识别,而您不必记住IP地址,而可以记住一些更令人难忘的内容,例如URL"myawesomesite.com".

如果要在localhost上执行此操作,则通常不需要执行DNS事务,但是如果需要,可以通过更新位于C:\ windows \ system32 \ drivers \ etc \ hosts的主机文件来完成. />
希望这会有所帮助.
It creates a mapping for your URL so that it resolves to your server. Think of it like a key-value dictionary, where key is your URL for e.g. myawesomesite.com and the value would be the IP address for e.g. 123.456.789.21. So when you browse to myawesomesite.com, internally that address would be resolved to the corresponding IP address of your server. This is done so that your server is identified easily on the internet and you don''t have to remember IP addresses but rather something more memorable like the URL "myawesomesite.com".

If you are doing it on localhost then you generally don''t need to do the DNS thing, but if you want you can by updating your hosts file which resides at C:\windows\system32\drivers\etc\hosts.

Hope this helps.


这篇关于为什么在IIS中添加URL之前需要在DNS中注册网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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