NetRock6
asked on
Setting DNS Suffix in Windows 10
Hi ..
Using powershell how can i change DNS suffix name globally not only for one network adapter.
Thanks
Using powershell how can i change DNS suffix name globally not only for one network adapter.
Thanks
You need to use GPO for that
use GPO and set 1st suffix as your AD domain and later add other suffixes as you want, latch this policy to domain level and it will take care of all machines
Policy setting: computer configuration\administrati ve templates\network\dns client and locate dns search suffix list and add there all with comma seperated
use GPO and set 1st suffix as your AD domain and later add other suffixes as you want, latch this policy to domain level and it will take care of all machines
Policy setting: computer configuration\administrati
ASKER
The cmdlet is not working in Windows 10 using the following example:
Thanks.
Set-DnsClientGlobalSetting -SuffixSearchList @("corp.contoso.com")
I need to script the process and cannot use AD.Thanks.
The command works fine for me on Win10, though I got a permission error at first because I hand't launched my PS console with elevated privileges.
Try executing the command on a client, run powershell as administrator first. If the command works, you should be fine to run in a script provided the script is run with sufficient privileges.
Try executing the command on a client, run powershell as administrator first. If the command works, you should be fine to run in a script provided the script is run with sufficient privileges.
The command working perfectly on my lab machine
did you open powershell with run as administrator?
did you open powershell with run as administrator?
ASKER
Certainly, with administrator privilege and It returns no errors... Do you guys reboot after running the cmdlet....
When you execute as administrator:
If you then execute:
is "Corp.contoso.com" listed?
I did not have to restart for this to apply. Once this script is successfully executed, you can go into the properties of a network interface and verify that the specified suffix is present.
Set-DnsClientGlobalSetting -SuffixSearchList @("corp.contoso.com")
If you then execute:
Get-DnsClientGlobalSetting
is "Corp.contoso.com" listed?
I did not have to restart for this to apply. Once this script is successfully executed, you can go into the properties of a network interface and verify that the specified suffix is present.
ASKER
yes it is listed. but I do not see it at the attached capture.
CaptureSuffix1.PNG
CaptureSuffix1.PNG
The attached screen shot is for primary dns suffix, this is normally set by your ISP DHCP server if machine is in workgroup or it can be primary ad domain suffix if machine iss ad joined
What you have added is search list and it won't list there
What is your requirement exactly
What you have added is search list and it won't list there
What is your requirement exactly
ASKER
Changing the primary DNS suffix, excat same as the attached file
This is what u r attempting
But may i know reason for same
But may i know reason for same
Primary dns suffix is automatically assigned to machine when you join machine to domain
You may chage it through screen shot you posted, its purpose is to append primary dns suffix for any single label host name resolution
For example once you added domain.local as primary dns suffix, if you ping server1, client will send request to dns server as serevr1.domain.local and DNS server will check if server1 is available with primary dns zone (domain.local) and if available you will get ping response.
Is this you wanted to do?
OR
you wanted to set dns suffix search list with domain.local as 1st entry and domain.com, domain.net as secondary and teritory entries respectively?
Now when you ping server1, 1st client will send query to dns as server1.domain.local, if dns don't find any record, client will send serevr1.domain.com and dns will check if he have any record associated with domain.com zone, if not, client will send query as server1.domain.net and if server found entry in domain.net zone, you will get that response
what you wanted to do?
You may chage it through screen shot you posted, its purpose is to append primary dns suffix for any single label host name resolution
For example once you added domain.local as primary dns suffix, if you ping server1, client will send request to dns server as serevr1.domain.local and DNS server will check if server1 is available with primary dns zone (domain.local) and if available you will get ping response.
Is this you wanted to do?
OR
you wanted to set dns suffix search list with domain.local as 1st entry and domain.com, domain.net as secondary and teritory entries respectively?
Now when you ping server1, 1st client will send query to dns as server1.domain.local, if dns don't find any record, client will send serevr1.domain.com and dns will check if he have any record associated with domain.com zone, if not, client will send query as server1.domain.net and if server found entry in domain.net zone, you will get that response
what you wanted to do?
ASKER
I need to change the primary DNS suffix value in the screen shot....
As stated above, from screen shot you posted change it, close all dialogue boxes one by one and reboot the machine
ASKER
@Mahesh,
Are you kidding...!!!?????
Doing this on over 100 PCs...
Are you kidding...!!!?????
Doing this on over 100 PCs...
Where did you mentioned that you need to change this in bulk????
Will check cmdlet to change primary dns suffix and post if worked
Will check cmdlet to change primary dns suffix and post if worked
ASKER
Kindly, read my question...it is clearly asking for "PowerShell"...
ASKER
I found no cmdlet... capable of doing this. I think we need to create a custom module
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great... Thanks for your help
This should allow for changing the suffix at a global level, non-specific to network interface.