DHCP scopes - searching and replacing DNS entries for multiple scopes

Hello,
Is it possible to export DHCP all scopes and then use search and replace to replace all DNS entries with different DNS server entries?
If yes, what would be the command to export all the scopes?

Also, if you replace the DNS entries and then import the scopes, would it work? If you could also list the command or script that exports all the scopes to csv file (readable format) for analyzing, would be great since I would like to analyze and find all the entries that need to replaced first.

Thank you very much!
creative555Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hypercat (Deb)Commented:
I have to ask why you would want to do this.  Do you have a ton of DHCP scopes that you need to change the DNS entries for?
Hypercat (Deb)Commented:
Here's are the commands to export the DHCP database on a server.  This would, I believe, export all of the scopes that are on the server:

1.  On the Windows 2003 DHCP server, navigate to a command prompt.
2.  Type the following Command: netsh [Enter]
3.  Type the following Command: DHCP [Enter]
4.  Type the following Command: server <\\Name or IP Address> [Enter]
5.  Type the following Command: export c:\w2k3DHCPdb all [Enter]

Note You must have local administrator permissions to export the data.

Once you have it exported, you can edit it using Notepad or another text editor.  However, in order to re-import the database you have to stop the DHCP Server service, delete (or rename) the existing database, and then import the database.  At the command prompt:

1.   Type the following Command: netsh [Enter]
2.   Type the following Command: DHCP [Enter]
3.   Type the following Command: server <\\Name or IP Address> [Enter]
4.   Type the following Command: import c:\w2k3DHCPdb  [Enter]
5.   Restart DHCP and verify the database has moved over properly.

I have gotten mixed results with the process of having to edit a DHCP database and then re-import it, so I advise some caution in using this method.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
creative555Author Commented:
Thank you very much!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.