Azure Pack: change Web Sites Default Domain DNS Suffix

To change the Default URL (DNS Suffix) for your Web Sites in Windows Azure Pack, follow these simple steps;

On the computer that is hosting the Web Sites Controller, run the following Windows PowerShell command:

Update (2014-07-14): It looks like the command above does not support -DnsSuffix anymore, but one of my readers has posted an alternative solution in the comments;

As an alternative you can use the following approach:

Check the change by using

And you’ll after that also have to do this:
On your SQL Server, open Management Studio.
In the Hosting Database admin.WebSystems table, change the
PublishingDns, FtpDns, and Subdomain to your desired URLs.

Restart your AzurePack servers to make the changes apply everywhere.

10 thoughts on “Azure Pack: change Web Sites Default Domain DNS Suffix”

  1. Hi, I receive errors that Websites does not exist as a module. Is this because I am using Web Sites v2? If so, do you know how to solve this on V2? Thank you.

  2. A parameter cannot be found that matches parameter name “DnsSuffix”… Any solution to this?

  3. Hi, you might be running the command on the wrong Virtual Computer.
    I think it has to be done on the one with the Web Sites role “Controller”.

    Try:
    Import-Module WebSites
    get-WebSitesConfig -type Global | select DnsSuffix

    It should show you the current DnsSuffix if you are doing it on the right server.
    Also, try to type the command manually without copy & paste from the web, it happens that the – is translated into a similar but slightly wider minus.

  4. As an alternative you can use the following approach:

    Import-Modules WebSites
    $Global = Get-WebSitesConfig -Type Global
    $Global.DNSSuffix = “new-domain.com”
    Set-WebSitesConfig -Type Global -pipelinevariable $Global

    Check the change by using
    get-WebSitesConfig -type Global | select DnsSuffix

  5. One correction to Peter’s command: When using pipeline variables, you should not use the $. You are passing the variable name, not the variable itself. The correct line would be:

    Set-WebSitesConfig -Type Global -pipelinevariable Global

    For clarity, I would recommend against using a variable named “Global”

    Import-Modules WebSites
    $GlobalConfig = Get-WebSitesConfig -Type Global
    $GlobalConfig.DNSSuffix = “new-domain.com”
    Set-WebSitesConfig -Type Global -pipelinevariable GlobalConfig

  6. Sweet, thank you Robert! I saw that you posted in the Technet forum too, excellent.
    I’ll update my blogpost.

  7. Update: Per a case I opened with Microsoft, the current way they recommend changing the suffix is to use one of the older (and deprecated) commandlets from the WebHostingSnapin.

    Add-PSSnapin WebHostingSnapin
    Set-HostingConfiguration -DnsSuffix “”

    You still need to update the admin table as before also.

Leave a Reply