简体   繁体   中英

How can i auto generate subdomains on azure from c# mvc application

i am developing an application where i want to make subdomains from my c# mvc application automatically rather than manually adding cname is it possible? if possible then please help

Prerequisites To delegate an Azure DNS subdomain, you must first delegate your public domain to Azure DNS. See Delegate a domain to Azure DNS for instructions on how to configure your name servers for delegation. Once your domain is delegated to your Azure DNS zone, you can delegate your subdomain.

Create a zone for your subdomain First, create the zone for the engineering subdomain.

New-AzDnsZone -ResourceGroupName -Name engineering.contoso.com

Note the name servers Next, note the four name servers for the engineering subdomain.

Get-AzDnsRecordSet -ZoneName engineering.contoso.com -ResourceGroupName -RecordType NS

Create a test record Create an A record in the engineering zone to use for testing.

New-AzDnsRecordSet -ZoneName engineering.contoso.com -ResourceGroupName -Name www -RecordType A -ttl 3600 -DnsRecords (New-AzDnsRecordConfig -IPv4Address 10.10.10.10).

Create an NS record Next, create a name server (NS) record for the engineering zone in the contoso.com zone.

Azure PowerShell

Copy $Records = @() $Records += New-AzDnsRecordConfig -Nsdname $Records += New-AzDnsRecordConfig -Nsdname $Records += New-AzDnsRecordConfig -Nsdname $Records += New-AzDnsRecordConfig -Nsdname $RecordSet = New-AzDnsRecordSet -Name engineering -RecordType NS -ResourceGroupName -TTL 3600 -ZoneName contoso.com -DnsRecords $Records Test the delegation Use nslookup to test the delegation.

Open a PowerShell window. At command prompt, type nslookup www.engineering.contoso.com. You should receive a non-authoritative answer showing the address 10.10.10.10.

Docs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM