什么DNS名称标签应该给我的Azure虚拟机? [英] What DNS Name Label should I give my Azure Virtual Machine?
问题描述
我有你的问题:
问题一:
假设我最终希望这个虚拟机托管网站woodswild.com,我应该给这个虚拟机的DNS名称标签?有关系吗?我所知道的是,它需要在全球独一无二。是否需要反映我要托管的域名(woodswild.com)?
问题二:
我是否甚至需要设置DNS名称?
问题三:
而且,现在我已经创建了它,我还可以将DNS名称标签从none更改为某些东西吗?如果是,如何?
< img src =https://i.stack.imgur.com/KX1gJ.pngalt =在此输入图像说明>
根本没有要求拥有DNS名称,或者与您正在设置的内容有任何关系。我有一个脚本,我使用它创建一个从GUID!
这是按照向Azure分配设置的通常过程。
- Get-something,将其分配给变量。
- 通过分配一些其他值来更改该变量的属性。
- 使用Set-something cmdlet将更改写入Azure。
在这种情况下,这是一个有点复杂,因为我们想要的最终结构看起来像这样
DnsSettings:{
DomainNameLabel:mytestdnsname,
Fqdn:mytestdnsname.westeurope.cloudapp.azure.com
}
假设我们创建了一个这样的PIP
New-AzureRmPublicIpAddress -Name test01PIP -ResourceGroupName test01`
-AllocationMethod动态位置westeurope
完全限定域名是自动设置的,所以我们只需要设置我们这样做的DomainNameLabel,
$ ip = get-AzureRmPublicIpAddress -Name test01PIP -ResourceGroupName test01 [1]
$ ip.DnsSettings + = @ {DomainNameLabel =mytestdnsname} [2]
设置-AzureRmPublicIpAddress -PublicIpAddress $ ip [3]
In my ongoing effort to wrap my head around Azure's new Resource Group model (see previous questions here and here), I am now trying to create a new Virtual Machine that will be used as a web server.
I have thee questions:
Question One:
Assuming I eventually want this VM to host the website woodswild.com, what DNS Name Label should I give this VM? Does it matter? All I know for sure is that it needs to be globally unique. Does it need to reflect the domain I want to host (woodswild.com)?
Question Two:
Do I even need to set the DNS name at all?
Question Three:
And, now that I've already created it, can I still change the DNS Name Label from "none" to something? And if so, how?
There is no requirement at all to either have a DNS name, or to have one that is anything to do with what you are setting up. I have a script that I use that creates one from a GUID!
This follows the usual process of assigning a setting to Azure.
- Get-something, assign it to a variable.
- Change a property of that variable, by assigning some other value.
- Write the change to Azure using the Set-something cmdlet.
in this case it is a little complicated since the ultimate structure we want looks like this
DnsSettings : {
"DomainNameLabel": "mytestdnsname",
"Fqdn": "mytestdnsname.westeurope.cloudapp.azure.com"
}
presuming we created an PIP like this
New-AzureRmPublicIpAddress -Name test01PIP -ResourceGroupName test01 `
-AllocationMethod Dynamic -Location westeurope
The fully qualified domain name is set automatically, so we just need to set the DomainNameLabel which we do like this,
$ip =get-AzureRmPublicIpAddress -Name test01PIP -ResourceGroupName test01 [1]
$ip.DnsSettings += @{DomainNameLabel = "mytestdnsname"} [2]
Set-AzureRmPublicIpAddress -PublicIpAddress $ip [3]
这篇关于什么DNS名称标签应该给我的Azure虚拟机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!