How to configure PTR record for my VM in Windows Azure

Jaime Stuardo 51 Reputation points
2020-10-05T19:17:51.423+00:00

Hello,

I need to create a PTR record for my VM in Windows Azure. It has a static IP, for example, 123.456.789.012

I went to this URL: https://resources.azure.com/

And navigated until I have found publicIPAddress. Initially, this JSON appeared there:

"dnsSettings": {
  "domainNameLabel": "(String)",
  "fqdn": "(String)",
  "reverseFqdn": "(String)"
},

I have replaced it by:

"dnsSettings": {
  "domainNameLabel": "exampleapp",
  "fqdn": "example.cl",
  "reverseFqdn": "example.cl"
},

Finally, when I pressed PUT button, this error appeared:

{
  "error": {
    "code": "ReverseFqdnDoesNotBelongToSubscription",
    "message": "ReverseFqdn example.cl that PublicIPAddress MyVM-ip is trying to use does not belong to subscription a7494537-8095-4a35-9662-111111111111. One of the following conditions need to be met to establish ownership: 1) ReverseFqdn matches fqdn of any public ip resource under the subscription; 2) ReverseFqdn resolves to the fqdn (through CName records chain) of any public ip resource under the subcription; 3) It resolves to the ip address (through CName and A records chain) of a static public ip resource under the subscription.",
    "details": []
  }
}

I am not sure what that error means. Can someone guide me in the right direction?

Thanks
Jaime

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
619 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,369 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Andreas Baumgarten 99,376 Reputation points MVP
    2020-10-05T19:30:06.117+00:00

    Maybe this is helpful:

    Configure reverse DNS for services hosted in Azure

    Regards
    Andreas Baumgarten

    (Please don't forget to Accept as answer if the reply is helpful)

    0 comments No comments

  2. Jaime Stuardo 51 Reputation points
    2020-10-05T20:35:42.75+00:00

    Hello Andreas,

    I have already read that page but I could not do that way, that is why I am asking for a guidance using https://resources.azure.com/ page.

    Well.... with the page you gave me, I got stuck at the first step. After I installed PowerShell module and authenticated, I ran the command:

    $pip = Get-AzPublicIpAddress -Name "PublicIp" -ResourceGroupName "MyGroup"
    

    it returns successfully, however, the second instruction I ran was this:

    PS > pip.DnsSettings = New-Object -TypeName "Microsoft.Azure.Commands.Network.Models.PSPublicIpAddressDnsSettings"
    pip.DnsSettings : The term 'pip.DnsSettings' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + pip.DnsSettings = New-Object -TypeName "Microsoft.Azure.Commands.Netw ...
    + ~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (pip.DnsSettings:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    

    How can I solve it?

    If I just run:

    PS > $pip.DnsSettings.ReverseFqdn = "example.cl"
    The property 'ReverseFqdn' cannot be found on this object. Verify that the property exists and can be set.
    At line:1 char:1
    + $pip.DnsSettings.ReverseFqdn = "example.cl"
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : PropertyNotFound
    

    So, I am stuck everywhere. How can I solve this?

    Thanks
    Jaime

    0 comments No comments

  3. Andreas Baumgarten 99,376 Reputation points MVP
    2020-10-05T20:52:36.753+00:00

    30271-pipdnssetting.jpg

    There is a $ missing in front of pip.setting in your script/line

    30198-pipdnssetting2.jpg

    Regards
    Andreas

    0 comments No comments

  4. Jaime Stuardo 51 Reputation points
    2020-10-05T21:02:29.627+00:00

    Sorry, I missed thr $ however, when I add with the $, I got the same error I got in https://resources.azure.com/ page and it is equal to the error I wrote in the question:

    > Set-AzPublicIpAddress -PublicIpAddress $pip
    
    Set-AzPublicIpAddress : ReverseFqdn example.cl. that PublicIPAddress MyVM-ip is trying to use does not belong to subscription a7494537-8095-4a35-9662-d9710282192c. One of the following conditions need to be met to establish ownership: 1) ReverseFqdn matches
    fqdn of any public ip resource under the subscription; 2) ReverseFqdn resolves to the fqdn (through CName records chain) of any public ip resource under the subcription; 3) It resolves to the ip address (through CName and A records chain) of a static public ip resource
    under the subscription.
    StatusCode: 400
    ReasonPhrase: Bad Request
    ErrorCode: ReverseFqdnDoesNotBelongToSubscription
    ErrorMessage: ReverseFqdn example.cl. that PublicIPAddress MyVM-ip is trying to use does not belong to subscription a7494537-8095-4a35-9662-d9710282192c. One of the following conditions need to be met to establish ownership: 1) ReverseFqdn matches fqdn of
    any public ip resource under the subscription; 2) ReverseFqdn resolves to the fqdn (through CName records chain) of any public ip resource under the subcription; 3) It resolves to the ip address (through CName and A records chain) of a static public ip resource under
    the subscription.
    OperationID : 9a281fde-107e-49b3-9c5f-6345fe5d2c03
    At line:1 char:1
    + Set-AzPublicIpAddress -PublicIpAddress $pip
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : CloseError: (:) [Set-AzPublicIpAddress], NetworkCloudException
        + FullyQualifiedErrorId : Microsoft.Azure.Commands.Network.SetAzurePublicIpAddressCommand
    

    Any further suggestion?

    Thanks
    Jaime