Update DNS servers for WorkSpaces Personal
If you need to update the DNS server IP addresses for your Active Directory after launching your WorkSpaces, you must also update your WorkSpaces with the new DNS server settings.
You can update your WorkSpaces with the new DNS settings in one of the following ways:
-
Update the DNS settings on the WorkSpaces before you update the DNS settings for Active Directory.
-
Rebuild the WorkSpaces after you update the DNS settings for Active Directory.
We recommend updating the DNS settings on the WorkSpaces before updating the DNS settings in Active Directory (as explained in Step 1 of the following procedure).
If you want to rebuild the WorkSpaces instead, update one of the DNS server IP addresses in your Active Directory (Step 2), and then follow the procedure in Rebuild a WorkSpace in WorkSpaces Personal to rebuild your WorkSpaces. After you've rebuilt your WorkSpaces, follow the procedure in Step 3 to test your DNS server updates. After completing that step, update the IP address of your second DNS server in Active Directory, and then rebuild your WorkSpaces again. Be sure to follow the procedure in Step 3 to test your second DNS server update. As noted in the Best Practices section, we recommend updating your DNS server IP addresses one at a time.
Best practices
When you're updating your DNS server settings, we recommend the following best practices:
-
To avoid disconnections and inaccessibility of domain resources, we strongly recommend performing DNS server updates during off-peak hours or during a planned maintenance period.
-
Don't launch any new WorkSpaces during the 15 minutes before and the 15 minutes after changing your DNS server settings.
-
When updating your DNS server settings, change one DNS server IP address at a time. Verify that the first update is correct before updating the second IP address. We recommend performing the following procedure (Step 1, Step 2, and Step 3) twice to update the IP addresses one at a time.
Step 1: Update the DNS server settings on your WorkSpaces
In the following procedure, the current and new DNS server IP address values are referred to as follows:
-
Current DNS IP addresses:
,OldIP1OldIP2 -
New DNS IP addresses:
,NewIP1NewIP2
Note
If this is the second time you're performing this procedure, replace
with OldIP1
and OldIP2 with NewIP1.NewIP2
If you have multiple WorkSpaces, you can deploy the following registry update to the WorkSpaces by applying a Group Policy Object (GPO) on the Active Directory OU for your WorkSpaces. For more information about working with GPOs, see Manage your Windows WorkSpaces in WorkSpaces Personal.
You can make these updates either by using the Registry Editor or by using Windows PowerShell. Both procedures are described in this section.
To update the DNS registry settings using the Registry Editor
-
On your Windows WorkSpace, open the Windows search box, and enter
registry editorto open the Registry Editor (regedit.exe). -
When asked "Do you want to allow this app to make changes to your device?", choose Yes.
-
In the Registry Editor, navigate to the following registry entry:
HKEY_LOCAL_MACHINE\SOFTWARE\Amazon\SkyLight
-
Open the DomainJoinDns registry key. Update
withOldIP1, and then choose OK.NewIP1 -
Close the Registry Editor.
-
Reboot the WorkSpace, or restart the service SkyLightWorkspaceConfigService.
Note
After you restart the service SkyLightWorkspaceConfigService, it can take up to 1 minute for the network adapter to reflect the change.
-
Proceed to Step 2, and update your DNS server settings in Active Directory to replace
withOldIP1.NewIP1
To update the DNS registry settings using PowerShell
The following procedure uses PowerShell commands to update your registry and restart the service SkyLightWorkspaceConfigService.
-
On your Windows WorkSpace, open the Windows search box, and enter
powershell. Choose Run as Administrator. -
When asked "Do you want to allow this app to make changes to your device?", choose Yes.
-
In the PowerShell window, run the following command to retrieve the current DNS server IP addresses.
Get-ItemProperty -Path HKLM:\SOFTWARE\Amazon\SkyLight -Name DomainJoinDNSYou should receive the following output.
DomainJoinDns :
OldIP1,OldIP2PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Amazon\SkyLight PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Amazon PSChildName : SkyLight PSDrive : HKLM PSProvider : Microsoft.PowerShell.Core\Registry -
In the PowerShell window, run the following command to change
toOldIP1. Be sure to leaveNewIP1as is for now.OldIP2Set-ItemProperty -Path HKLM:\SOFTWARE\Amazon\SkyLight -Name DomainJoinDNS -Value "NewIP1,OldIP2" -
Run the following command to restart the service SkyLightWorkspaceConfigService.
restart-service -Name SkyLightWorkspaceConfigServiceNote
After you restart the service SkyLightWorkspaceConfigService, it can take up to 1 minute for the network adapter to reflect the change.
-
Proceed to Step 2, and update your DNS server settings in Active Directory to replace
withOldIP1.NewIP1
If you have more than one Amazon Linux 2 WorkSpace, we recommend that you use a
configuration management solution to distribute and enforce policy. For example, you can use
Ansible
To update the DNS server settings on a Amazon Linux 2 WorkSpace
-
On your Linux WorkSpace, open a Terminal window.
-
Use the following Linux command to edit the
/etc/dhcp/dhclient.conffile. You must have root user privileges to edit this file. Either become root by using thesudo -icommand, or run all commands withsudoas shown.sudo vi /etc/dhcp/dhclient.confIn the
/etc/dhcp/dhclient.conffile, you will see the followingprependcommand, whereandOldIP1are the IP addresses of your DNS servers.OldIP2prepend domain-name-servers
OldIP1,OldIP2; # skylight -
Replace
withOldIP1, and leaveNewIP1as is for now.OldIP2 -
Save your changes to
/etc/dhcp/dhclient.conf. -
Reboot the WorkSpace.
-
Proceed to Step 2, and update your DNS server settings in Active Directory to replace
withOldIP1.NewIP1
If you have more than one Ubuntu WorkSpace, we recommend that you use a
configuration management solution to distribute and enforce policy. For example, you can use
Landscape
To update the DNS server settings on a Ubuntu WorkSpace
-
On your Ubuntu WorkSpace, open a Terminal window and run the following command. You must have root user privileges to edit this file. Either become root by using the
sudo -icommand, or run all commands withsudoas shown.sudo vi /etc/netplan/zz-workspaces-domain.yaml -
In the yaml file, you will see the following
nameservercommand.nameservers: search:[Your domain FQDN] addresses:[OldIP1,OldIP2]Replace the
andOldIP1with theOldIP2andNewIP1.NewIP2If you have multiple DNS servers IP addesses, add them as comma separated values. For example,
[.NewDNSIP1,NewDNSIP2,NewDNSIP3] Save the yaml file.
-
Run the command
sudo netplan applyto apply the changes. -
Run the command
resolvectl statusto verify that the new DNS IP address is being used. -
Proceed to Step 2, and update your DNS server settings in Active Directory.
If you have more than one Red Hat Enterprise Linux WorkSpace, we recommend that you use a
configuration management solution to distribute and enforce policy. For example, you can use
Ansible
To update the DNS server settings on a Red Hat Enterprise Linux WorkSpace
-
On your Red Hat Enterprise Linux WorkSpace, open a Terminal window and run the command below. You must have root user privileges to edit this file. Either become root by using the
sudo -icommand, or run all commands withsudoas shown.sudo nmcli conn modify CustomerNIC ipv4.dns 'NewIP1NewIP2' -
Run the following command.
sudo systemctl restart NetworkManager -
To check the updated DNS and network configuration run the following command.
nmcli device show eth1 -
Proceed to Step 2, and update your DNS server settings in Active Directory.
Step 2: Update the DNS server settings for Active Directory
In this step, you update your DNS server settings for Active Directory. As noted in the Best Practices section, we recommend updating your DNS server IP addresses one at a time.
To update your DNS server settings for Active Directory, see the following documentation in the AWS Directory Service Administration Guide:
-
AD Connector: Update the DNS Address for Your AD Connector
-
AWS Managed Microsoft AD: Configure DNS Conditional Forwarders for Your On-premises Domain
-
Simple AD: Configure DNS
After updating your DNS server settings, proceed to Step 3.
Step 3: Test the updated DNS server settings
After completing Step 1 and Step 2, use the following procedure to verify that your updated DNS server settings are working as expected.
In the following procedure, the current and new DNS server IP address values are referred to as follows:
-
Current DNS IP addresses:
,OldIP1OldIP2 -
New DNS IP addresses:
,NewIP1NewIP2
Note
If this is the second time you're performing this procedure, replace
with OldIP1
and OldIP2 with NewIP1.NewIP2
-
Shut down the
DNS server.OldIP1 -
Log in to a Windows WorkSpace.
-
On the Windows Start menu, choose Windows System, then choose Command Prompt.
-
Run the following command, where
is the name of your Active Directory (for example,AD_Namecorp.example.com).nslookupAD_NameThe
nslookupcommand should return the following output. (If this is the second time you're performing this procedure, you should seein place ofNewIP2.)OldIP2Server:
Full_AD_NameAddress:NewIP1Name:AD_NameAddresses:OldIP2NewIP1 -
If the output is not what you were expecting or if you receive any errors, repeat Step 1.
-
Wait for an hour and confirm that no user issues have been reported. Verify that
is getting DNS queries and responding with answers.NewIP1 -
After you've verified that the first DNS server is working properly, repeat Step 1 to update the second DNS server, this time replacing
withOldIP2. Then repeat Step 2 and Step 3.NewIP2
-
Shut down the
DNS server.OldIP1 -
Log in to a Linux WorkSpace.
-
On your Linux WorkSpace, open a Terminal window.
-
The DNS server IP addresses returned in the DHCP response are written to the local
/etc/resolv.conffile on the WorkSpace. Run the following command to view the contents of the/etc/resolv.conffile.cat /etc/resolv.confYou should see the following output. (If this is the second time you're performing this procedure, you should see
in place ofNewIP2.)OldIP2; This file is generated by Amazon WorkSpaces ; Modifying it can make your WorkSpace inaccessible until reboot options timeout:2 attempts:5 ; generated by /usr/sbin/dhclient-script search
region.compute.internal nameserverNewIP1nameserverOldIP2nameserverWorkSpaceIPNote
If you make manual modifications to the
/etc/resolv.conffile, those changes are lost when the WorkSpace is restarted. -
If the output is not what you were expecting or if you receive any errors, repeat Step 1.
-
The actual DNS server IP addresses are stored in the
/etc/dhcp/dhclient.conffile. To see the contents of this file, run the following command.sudo cat /etc/dhcp/dhclient.confYou should see the following output. (If this is the second time you're performing this procedure, you should see
in place ofNewIP2.)OldIP2# This file is generated by Amazon WorkSpaces # Modifying it can make your WorkSpace inaccessible until rebuild prepend domain-name-servers
NewIP1,OldIP2; # skylight -
Wait for an hour and confirm that no user issues have been reported. Verify that
is getting DNS queries and responding with answers.NewIP1 -
After you've verified that the first DNS server is working properly, repeat Step 1 to update the second DNS server, this time replacing
withOldIP2. Then repeat Step 2 and Step 3.NewIP2