Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

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,096 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

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…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
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 demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

715 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