如何获得从由天青webrole的startuptask消耗REST服务的DNS名称 [英] How to get DNS name from REST service which is consumed by startuptask of Azure webrole

查看:362
本文介绍了如何获得从由天青webrole的startuptask消耗REST服务的DNS名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与它的不可能没有证书和放大器获得DNS名称和环境的详细信息(分期VS生产)证实;管理API。

I have confirmed with that it's not possible to get DNS Name and environment details (staging vs production) without certificate & management API.

不过让我们考虑一下我的情况,我的startuptask(EXE)消费REST服务发布的一些数据,以便在REST服务我可以做一些伎俩让DNS名称?

However let's consider my case in that my startuptask(exe) consume REST service to post some data so in that REST service can i do some trick to get DNS name?

我曾尝试与以下

HttpContext.Current.Request.UserHostName 但它是一样的
HttpContext.Current.Request.UserHostAddress

请给我建议,如果任何人有你做这种类型的把戏。

Please give me suggestion if anyone have you did this type of trick.

更新

的使用主机名和放大器; HostAddress我能够得到webrole的IP(证实了浏览器请求),但是当我尝试与nslookup命令,然后它说我的不存在的域

Using HostName & HostAddress i am able to get IP of that webrole (confirmed with browser request) but when i try that with nslookup command then it says me that Non-existent domain

天青是否不支持反向查找?

Does Azure not support reverse lookup?

先谢谢了。

推荐答案

在我研究上面的细节我要说的是,使用上面的技巧,你得到你的服务的外部饰面VIP地址。

After I study the above details I would say that using above trick, you are getting the external facing VIP address about your service.

让我们考虑在这种情况下它会是如下,如果你与你的应用程序配置的端口80,你可以在任何浏览器使用此IP地址,以验证您所做的:

Lets consider in that case it would be something as below and if you have port 80 configured with your application you could use this IP address in any browser to verify and you did:

65.52.14.112

现在,让我们对IP地址运行nslook,它肯定会返回你在说什么:

Now let's run nslook on IP address and it sure returns what you said:

C:\myTools>nslookup 65.52.14.112
Server:  router.belkin
Address:  192.168.2.1

*** router.belkin can't find 65.52.14.112: Non-existent domain

现在的第二个让我们考虑您知道托管服务的名称(这是我的服务,我知道名字),所以让我们尝试与NSLOOKUP是:

Now for a second lets consider you know the hosted service name (it is my service and I know the name) so lets try to use nslookup with that:

C:\myTools>nslookup azurevmassistant.cloudapp.net
Server:  router.belkin
Address:  192.168.2.1

Non-authoritative answer:
Name:    azurevmassistant.cloudapp.net
Address:  65.52.14.112

正如你可以看到上面的主机名解析的IP地址,这就是它。您还需要在这两个你击中了在Windows Azure负载均衡器不是服务本身的上述情况,了解。

As you can see above the hostname resolves the IP address and that's it. Also you would need to understand in both of the above case you were hitting the Windows Azure loadbalancer not the service itself.

我可以证实,截至目前在Windows Azure不支持反向查找,如果你认为是很重要的它是伟大的机会,让您的声音在这里提交请求:的http://www.mygreatwindowsazureidea.com/pages/34192-windows-azure-feature-voting

I am able to verify that as of now the Windows Azure does not support "reverse lookup" and if you think that is important it is great chance to let your voice heard and submit the request here: http://www.mygreatwindowsazureidea.com/pages/34192-windows-azure-feature-voting

这篇关于如何获得从由天青webrole的startuptask消耗REST服务的DNS名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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