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
1,833 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I resolved this myself.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Configuring network clients can be a chore, especially if there are a large number of them or a lot of itinerant users.  DHCP dynamically manages this process, much to the relief of users and administrators alike!
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …

744 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now