none
Change Primary DNS Suffix

    Question

  •  

    I am trying to change the 'Primary DNS Suffix' on a Core installation (RC1 v735 Hyper-V Build)

     

    Essentially I have two machines one GUI and one CORE

     

    GUI

    C:\>ipconfig /all

    Windows IP Configuration

       Host Name . . . . . . . . . . . . : w2k8gui
       Primary Dns Suffix  . . . . . . : mydomain.com
       Node Type . . . . . . . . . . . . .: Hybrid
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . .  . : No
       DNS Suffix Search List. . . .  . : mydomain.com

     

    CORE

    C:\>ipconfig /all

    Windows IP Configuration

       Host Name . . . . . . . . . . . . : w2k8core
       Primary Dns Suffix  . . . . . . :
       Node Type . . . . . . . . . . . . .: Hybrid
       IP Routing Enabled. . . . . . . : No
       WINS Proxy Enabled. . . . .  : No


     

    In the GUI install you would open

    -> 'System Properties'

    -> 'Computer Name'

    -> 'Change'

    -> 'More'

    And then add the FQDN name i.e. mydomain.com to the 'Primary DNS Suffix of this computer' and click the OK's and restart the computer and it is done.

     

    Now I am trying to get the same results in IPCONFIG for both the GUI & Core installs.

     

    I have been hunting down command line options for NETSH.EXE and NETDOM.EXE and how to do this but have not found the right switch yet. Neither of these machines are joined to a domain and are both only in a workgroup named 'Workgroup' and I do not want to join them to a DC yet.

     

    So can anyone give me a hand in what I should do on the CORE install that is the equivelent steps for the GUI instructions above?

     

    Cheers,

     

    Stephen Edgar

     

    Wednesday, January 02, 2008 5:39 AM

Answers

  • It's true NetSh and NetDom don't offer commands to change the DNS suffix.

    I can think of two ways to change the suffix though:

    1. Using Regedit
      The primary DNS suffix is stored in the registry in the following location:
       
      HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Paramaters
       
      You might want to change the values for the following registry keys:
       
      1. Domain (REG_SZ)
      2. SearchList (REG_SZ)
         
         
    2. Using Group Policy
      Since you don't want to join your servers to a domain you can't use Group Policies with an Active Directory source, but you will still be able to change the Local Policies with ease, although it won't be pretty security-wise
       
      1. Log on to a Windows Vista or Windows Server 2008 box with an Administrator account with the exact same password as the Administrator account on the Server Core box
      2. Run gpedit.msc
      3. Open the Computer Policy
      4. (Open Policies)
      5. Open Administrative Templates
      6. Open Network
      7. Open DNS Client
      8. Double click the "Primary DNS Suffix" policy
      9. Enable the "Primary DNS Suffix" policy and type your suffix
      10. Press OK
      11. Open the "DNS Suffix Search Order" policy
      12. Enable the "DNS Suffix Search Order" and type your suffixes
      13. Press OK
      14. Log on the Server Core box
      15. Perform the following command:
         
        gpupdate
         
        The settings from your Local Policy should take effect.
         

    You might want to consider running ipconfig /registerdns after changing the Primary DNS Suffix. 

    Wednesday, January 02, 2008 9:15 AM

All replies

  • It's true NetSh and NetDom don't offer commands to change the DNS suffix.

    I can think of two ways to change the suffix though:

    1. Using Regedit
      The primary DNS suffix is stored in the registry in the following location:
       
      HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Paramaters
       
      You might want to change the values for the following registry keys:
       
      1. Domain (REG_SZ)
      2. SearchList (REG_SZ)
         
         
    2. Using Group Policy
      Since you don't want to join your servers to a domain you can't use Group Policies with an Active Directory source, but you will still be able to change the Local Policies with ease, although it won't be pretty security-wise
       
      1. Log on to a Windows Vista or Windows Server 2008 box with an Administrator account with the exact same password as the Administrator account on the Server Core box
      2. Run gpedit.msc
      3. Open the Computer Policy
      4. (Open Policies)
      5. Open Administrative Templates
      6. Open Network
      7. Open DNS Client
      8. Double click the "Primary DNS Suffix" policy
      9. Enable the "Primary DNS Suffix" policy and type your suffix
      10. Press OK
      11. Open the "DNS Suffix Search Order" policy
      12. Enable the "DNS Suffix Search Order" and type your suffixes
      13. Press OK
      14. Log on the Server Core box
      15. Perform the following command:
         
        gpupdate
         
        The settings from your Local Policy should take effect.
         

    You might want to consider running ipconfig /registerdns after changing the Primary DNS Suffix. 

    Wednesday, January 02, 2008 9:15 AM
  • The third way is:
    netdom computername w2k8core /MakePrimary:w2k8core.mydomain.com
    • Proposed as answer by Adam Paradis Wednesday, May 20, 2009 10:46 PM
    Wednesday, February 25, 2009 9:55 AM
  • I like the netdom command better than messing with little known or maybe undocumnted registry values, but when I tried it on Hyper-V Server R2 it said

    Unable to make <FQDN>
    the primary name for the computer.
    The error is:

    Try "NETDOM HELP" for more information.

    Is that for full Windows only or should it work on Hyper-V Server R2?

    • Proposed as answer by The Zoo Saturday, August 20, 2011 11:10 AM
    • Unproposed as answer by The Zoo Saturday, August 20, 2011 11:10 AM
    Friday, April 09, 2010 12:15 AM
  • netdom computername hostname.domain.com /add:newhostname.newdomain.com

    netdom computername hostname.domain.com /makeprimary:newhostname.newdomain.com


    netdom computername newhostname.newdomain.com /remove:oldmachine.domain.com

     

    If it is newly installed machine

     

    netdom renamecomputer %computername% /Newname:2008R2core

    netdom computername %computername% /makeprimary:%computername%.testdomain.com

     

    • Proposed as answer by Sarith Monday, December 27, 2010 10:01 AM
    Monday, December 27, 2010 9:58 AM
  • I was searching for this myself. For workgroup computers, I came to this final solution:

    Computername = WGServer01
    Desired Primary DNS Suffix = mydomain.com

    First add the FQDN of the computer:
    netdom computername WGServer01 /Add:WGServer01.mydomain.com
    Second make the the just add FQDN of the computer the primary:
    netdom computername WGServer01 /MakePrimary:WGServer01.mydomain.com

    If you only try to perform the second step without the firt you'll get the error:
    Unable to make <FQDN>
    the primary name for the computer.
    The error is:
    Try "NETDOM HELP" for more information.

    • Proposed as answer by Byron Obando Monday, July 16, 2012 11:20 PM
    Saturday, August 20, 2011 11:18 AM
  • To be precise: the  "Primary DNS Suffic" policy requires reboot to be applied.

    bye


    Dario Palermo

    Wednesday, August 22, 2012 1:09 PM
  • netdom works!!!

    After reboot, of course.

    THX

    Sabine

    • Proposed as answer by Sabine A aus H Thursday, November 14, 2013 11:30 AM
    Thursday, November 14, 2013 11:30 AM
  • Registry works well here.

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
    "SearchList"="company1.local,company2.com,company.com"

    Use a batch file as a logon script or use psexec, etc.. (no reboot needed if psexec)

    my batch file contents:

    @ECHO OFF

    regedit /S \\192.168.125.200\share$\scripts\DNSSearchOrder.reg
    echo "%COMPUTERNAME%" >> "\\192.168.125.200\share$\DNSSearchOrderSet.txt"

    exit

    Tuesday, January 21, 2014 7:46 PM