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,853 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

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

I was supporting a handful of Windows 2008 (non-R2) 2 node clusters with shared quorum disks. Some had SQL 2008 installed and some were just a vendor application that we supported. For the purposes of this article it doesn’t really matter which so w…
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!
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

929 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

10 Experts available now in Live!

Get 1:1 Help Now