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

You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
A safe way to clean winsxs folder from your windows server 2008 R2 editions
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 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…

806 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