Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

netsh DHCP error: Server x.x.x.x is not a valid DNS Server when setting VIP as DNS server on a DHCP scope

Posted on 2012-03-21
4
Medium Priority
?
2,177 Views
Last Modified: 2016-10-25
We are using a Netscaler to load balance our DNS servers internally. This is a new change, so I am trying to update our DHCP scopes with the new IP addresses. We have over 200 scopes, so to do this I want to use netsh.

We are running in a Windows 2008R2 enviroment

The problem I am having is that it wants to verify the DNS server address first, and fails because it cannot due the fact that the IP is a Netscaler.

The VIP itself does work. We have tested by both setting our adapters manually, and manually configuring one of our test scopes. When you manually configure the DNS option on a DHCP scope you also get an error. But it allows you to continue with the change.

Is there a switch that I can use to prevent verification when using netsh?
or
do I need to create some type of DNS record for the VIP?

Here is the code i am using with the error.

for /f "tokens=1" %%a in (C:\script\cgy.txt) DO netsh DHCP server 192.31.165.40 scope %%a set optionvalue 006 ipaddress 192.31.142.57 192.31.149.57


Changed the current scope context to 192.31.145.0 scope.
Server 192.31.142.57 is not a valid DNS Server.

Server 192.31.149.57 is not a valid DNS Server.


Thanks everyone
0
Comment
Question by:ssiimmppllee
  • 3
4 Comments
 
LVL 17

Expert Comment

by:Premkumar Yogeswaran
ID: 37776983
Hi,

The command you using is seems to be perfect..

Can you check by changing the case of IP Address

for /f "tokens=1" %%a in (C:\script\cgy.txt) DO netsh DHCP server 192.31.165.40 scope %%a set optionvalue 006 IPADDRESS 192.31.142.57 192.31.149.57

Also try the command directly without script

netsh DHCP server 192.31.165.40 scope 192.31.145.0 set optionvalue 006 IPADDRESS 192.31.142.57 192.31.149.57

Good luck..

Regards,
Prem
0
 
LVL 1

Author Comment

by:ssiimmppllee
ID: 37777057
Thanks premglitz,

But that dose not seem to help. I did find a switch "/DHCPFullForce" for netsh that is supposed to be used for setting option 006 when the DNS server is not available. But it does not seem to help either.

netsh DHCP server 192.31.165.40 scope 192.31.145.0 set optionvalue 006 IPADDRESS 192.31.142.57 192.31.149.57 /DhcpFullForce

DHCP Server Scope Set OptionValue failed.

Parameter(s) passed are either incomplete or invalid.
0
 
LVL 1

Accepted Solution

by:
ssiimmppllee earned 0 total points
ID: 37777627
I found a way to do this using powershell. I downloaded the DHCP power shell module for this. I was able to use a csv file to change mutiple scopes at the same time.


Using a CSV file to feed the code


example of csv

dhcpserver,scope
172.31.65.40,172.31.145.0
172.31.65.40,172.31.146.0
172.31.65.40,172.31.147.0

Open in new window


power shell code

Import-Csv C:\downloads\dhcpscopelist.csv | foreach {
  	$scope="{0}/{1}" -f $_.dhcpserver,$_.scope
	Set-DHCPOption -Owner $scope -OptionID 006 -DataType IPADDRESS -Value "172.31.82.57 172.31.9.57" -Force
}

Open in new window

0
 
LVL 1

Author Closing Comment

by:ssiimmppllee
ID: 37795129
I resolved this myself.
0
Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question