Computer step by step
 Make your Pc better
Description:  

Specifies the primary Domain Name System (DNS) suffix for all affected computers. The primary DNS suffix is
used in DNS name registration and DNS name resolution.

This setting lets you specify a primary DNS suffix for a group of computers and prevents users, including
administrators, from changing it.

If you disable this setting or do not configure it, each computer uses its local primary DNS suffix, which is
usually the DNS name of Active Directory domain to which it is joined. However, administrators can use
System in Control Panel to change the primary DNS suffix of a computer.

To use this setting, in the text box provided, type the entire primary DNS suffix you want to assign. For
example, microsoft.com.

This setting does not disable the DNS Suffix and NetBIOS Computer Name dialog box that administrators use
to change the primary DNS suffix of a computer. However, if administrators enter a suffix, that suffix is ignored
while this setting is enabled.

Important: To make changes to this setting effective, you must restart Windows on all computers affected by
the setting.

Note: To change the primary DNS suffix of a computer without setting a setting, click System in Control Panel,
click the Network Identification tab, click Properties, click More, and then enter a suffix in the "Primary DNS
suffix of this computer" box.

For more information about DNS, see "Domain Name System (DNS)" in Help

Supported on: At least Windows 2000.
Primary DNS Suffix
Description Gpedit Regedit CMD Back VBScript PowerShell Script
Gpedit:   

Please perform the following steps:

Please go to Pearl button (Start) and click on the Search programs and files
For more information about the change from Start to Pearl button click here
Type gpedit.msc and press Enter
In the Group Policy window please navigate to Computer Configuration -> Administrative Templates ->
Network -> DNS Client and open Primary DNS Suffix.
Not Configured -> is the Default state
Enabled -> apply this GPO
Disabled -> this GPO will not be applied

To finish press ok button and close Group Policy window.
Description Gpedit Regedit CMD Up Back VBScript
Type regedit and press ok
Please confirm User Account Control pop-up
Microsoft official disclaimer

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by
using another method. These problems might require that you reinstall the operating system. Microsoft
cannot guarantee that these problems can be solved. Modify the registry at your own risk.

Note: This registry key is created by Group Policy when this GPO is Enable. The GPO Default state is Not
Configured -> this registry entry is not present. For Disable this registry entry is not present.

Please navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient and
locate
NV PrimaryDnsSuffix registry key
Regedit:          

Please perform the following steps:

Please go to Pearl button (Start) and click on the Search programs and files
For more information about the change from Start to Pearl button click here
Description Gpedit Regedit CMD Up Back VBScript
Double click on NV PrimaryDnsSuffix and edit the value:

To Enable:
Change the data value with abc.com

To finish press ok button and close Registry Editor window

Note: Manual editing of this registry key will not be reflected in Group Policy. If you modify this GPO from
Group Policy this registry key will be rewritten.
Description Gpedit Regedit Back CMD VBScript Up
Type cmd, right click on cmd icon under the Programs and click on Run as administrator
Please confirm User Account Control pop-up
Please select, right and copy a registry key from below, then right click on command prompt window
, select Paste and press Enter

Enabled:
REG add "HKLM\SOFTWARE\Policies\Microsoft\System\DNSClient" /v "NV PrimaryDnsSuffix" /t REG_SZ /d abc.com /f

Not Configured\Disabled:
REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\System\DNSClient" /v "NV PrimaryDnsSuffix" /f

Note: Manual editing of this registry key will not be reflected in Group Policy. If you modify this GPO from
Group Policy this registry key will be rewritten.
CMD:          

Please perform the following steps:

Please go to Pearl button (Start) and click on the Search programs and files
For more information about the change from Start to Pearl button click here
Description Gpedit Regedit Back CMD VBScript Up
VBScript:          

Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Policies\Microsoft\System\DNSClient"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strValueName = "NV PrimaryDnsSuffix"
'Enabled
strValue = "abc.com"
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
'Not Configured
'oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName
Description Gpedit Regedit Back CMD VBScript Up
PowerShell Script :          

Enabled

$RegKey = "HKLM:\SOFTWARE\Policies\Microsoft"
If(Test-Path ($RegKey + "\System"))
{
 $RegKey = "HKLM:\SOFTWARE\Policies\Microsoft\System"
 If(Test-Path ($RegKey + "\DNSClient"))
 {
   $RegKey = "HKLM:\SOFTWARE\Policies\Microsoft\System\DNSClient"
   ##Enabled
   New-ItemProperty -path $RegKey -name "NV PrimaryDnsSuffix" -value abc.com -PropertyType String -Force
 }
 else
 {
   New-Item -path $RegKey -name DNSClient
   $RegKey = "HKLM:\SOFTWARE\Policies\Microsoft\System\DNSClient"
   ##Enabled
   New-ItemProperty -path $RegKey -name "NV PrimaryDnsSuffix" -value abc.com -PropertyType String
 }
}
else
{
 New-Item -path $RegKey -name System
 $RegKey = "HKLM:\SOFTWARE\Policies\Microsoft\System"
 New-Item -path $RegKey -name DNSClient
 $RegKey = "HKLM:\SOFTWARE\Policies\Microsoft\System\DNSClient"
 ##Enabled
 New-ItemProperty -path $RegKey -name "NV PrimaryDnsSuffix" -value abc.com -PropertyType String
}

Not Configured\Disabled

$RegKey = "HKLM:\SOFTWARE\Policies\Microsoft"
Remove-ItemProperty -Path($RegKey + "\System\DNSClient") -name "NV PrimaryDnsSuffix"
If( (Get-Item -Path($RegKey + "\System\DNSClient")).ValueCount -eq 0 -and (Get-Item -Path($RegKey + "\System\DNSClient")).SubKeyCount -eq 0)
{
 Remove-Item -Path($RegKey + "\System\DNSClient")
 If( (Get-Item -Path($RegKey + "\System")).ValueCount -eq 0 -and (Get-Item -Path($RegKey + "\System")).SubKeyCount -eq 0)
 {
   Remove-Item -Path($RegKey + "\System")
 }
}
Up Back PowerShell Script PowerShell Script PowerShell Script PowerShell Script PowerShell Script