Sun 29 Jul 2007
How To: Change a Domain Controller IP address
Posted by Robert under Domain Controllers , HowTo , Networking[18] Comments
A friend came to me this week with an issue he had earlier – he had to change the subnet of a client’s network, and issues with the Windows 2003 Domain Controller appeared. Here’s how to avoid (or fix) the problem. For this HowTo, I’ll be using a current network of 192.168.1.2/24, with the server being it’s own DNS and WINS, and a gateway of 192.168.1.1. We’ll be changing the server to 172.31.2.2/24, and using the domain name “foobar.local”.
- Why are you changing the subnet? Most often, I’ve had to do this for customers because a business partner’s subnet has conflicts that are coming up during VPN tunnel creation. I’ve had other reasons, and you might too – but that’s the most common I’ve seen – 2 sites that are both 192.168.1.0/24 trying to build a VPN tunnel to each other.
- Now that you have a good reason to go through the pain, determine your layout – I’m going to write this for a single DC environment and point out a few changes for a double-DC environment. If you have more, you should be able to extrapolate the requirements from there, but you can also leave some comments and I can write another post if required. I’ll also be writing cmd scripts for most changes, rather than attaching huge (pixel-size) images.
- Determine the new subnet.
- Add the reverse lookup zone to DNS for your new network. In this case, in the DNS wizard, you’d make the reverse zone “172.31.2″ (filling in all boxes). This makes the zone name “2.31.172.in-addr.arpa” or “172.31.2.x” in the DNS console.
- Open Active Directory Sites and Services. Right-Click “Subnets” and add in the new subnet (172.31.2.0 with a Subnet Mask of 255.255.255.0). You’ll see the subnet listed as CIDR notation in the box (172.31.2.0/24) for verification. Pick the site that the new subnet belongs in (probably Default-First-Site-Name), and click “OK”. This guarnantees that AD will recognize the new site properly.
- Determine the new IP for the DC, and *add* it to the DC’s adapter. Do NOT remove the existing IP, yet. Don’t add the new gateway, yet. Just add the new IP, and save the settings.
netsh interface ip add address "local area connection" 172.31.2.2 255.255.255.0
(This command assumes that your DC has a static IP address. I haven’t seen a site use DHCP for their DCs yet, but it’s a possibility. This command on a DHCP address will set only a SINGLE address with no gateway, and could leave you with 0 remote access to the server.) - Verify that the new IP is showing up on the server.
ipconfig - Get the server to register its new info in DNS
ipconfig /registerdns - Wait and watch the Application and System event logs for DNS related errors. Also check that the DNS server is publishing the new IP address, not just as the server name, but also as the domain name, and the DCs (This can take up to, but shouldn’t take longer than, 15 minutes):
nslookup foobar.local
Also, open the DNS console and look inside “_msdcs.foobar.local” to see that the GUID of the server is listed with both IPs. - Once the server is advertising the new IP, you can swap the system to use the new IP range completely. It’s not time to remove the old IP yet though. This is the time to change the gateway, DNS servers, and WINS server. Since the server is listening on, and advertising on, the old and new IPs, DNS shouldn’t have any issues.
netsh interface ip set address "local area connection" static 172.31.2.2 255.255.255.0 172.31.2.1 10
netsh interface ip add address "local area connection" 192.168.1.2 255.255.255.0
netsh interface ip set dns "local area connection" static 172.31.2.2
netsh interface ip set wins "local area connection" static 172.31.2.2
This can, like all other steps, also be done in the GUI quite easily, by just shifting the orders of some things (IPs), and replacing others (DNS/WINS/Gateway). - Now re-register the server with itself, looking for error messages in the Application and System logs.
ipconfig /registerdns - Remember that changes to DNS can take up to 15 minutes to appear, as you watch the logs for errors, and check dns.
nslookup foobar.local
What you’re looking for in the nslookup is to see the address of every domain controller in your domain. If this is a single server (like a Small Business Server 2003 network), you should, at this point, see 2 or 3 addresses (depending on how you set up your public network, for SBS2003). - If everything looks good here, this is a good time to test some logons to make sure things are working properly. This is the point in the project where I normally create the new DHCP scope, deactivate (not delete) the old scope, and change the LAN settings on the router. This is also a good time to reboot some of the client PCs to make sure that they can boot up properly, get IP addresses in the new subnet, login without errors (remember to check that Application log!), and get online without issues.
Because we haven’t removed the old IP from the server yet, the biggest issue you *should* run into is a client who gets an IP from the old subnet, or is statically set. They’ll log in ok, but won’t be able to get to the internet (unless you’ve got SBS2003, and the server is also your router). At this point in time, it’ll be easy to figure out if the new IP is working – clients that can log in and get access to resources are logging in to the IP address for the DC that’s local to them – if they’re in the new subnet, then your new IP is working. You can now reboot your DC as a final test (or act of faith, as your experience may prompt). - When the DC comes back up, log in, and remove the old IP address – this is easiest in the GUI, but if you’re doing it with netsh, I prefer to just reset the DC settings completely.
netsh interface ip set address "local area connection" static 172.31.2.2 255.255.255.0 172.31.2.2 10
ipconfig /registerdns
nslookup foobar.local
Now it’s cleanup time. - Open Active Directory Sites and Services. Delete the old subnet.
- Open up your DNS server and make sure your forwarders are correct – lots of small offices skip this step – your forwarders should be the IP addresses of the DNS servers that your ISP gave you. Don’t put these into your DHCP scope DNS servers list, or even in the list of DNS servers on your server – they go in the “forwarders” section here.
- That’s it. Your clients are set up and ready to go, your server is healthy, and now you get to tackle the problem that made you have to change the IP in the first place!
For those who are having issues, because they’re finding this after attempting the change, or for my friend who prompted me to write this, here are some suggestions:
- Add the old IP back to the server, run <code>ipconfig /registerdns</code> and wait for the old IP to take. Now verify that the server’s logging in properly, and not giving error messages.
- Do you have all the zones in DNS, so that registration can take? Many small sites forget to put in the reverse zones into the DNS server.
- Go back and check Active Directory Sites and Services to verify that both the old and new subnets are listed. While you’re in transition, all subnets should be listed in all locations.
- If your server is screwed up badly enough that you can’t even log in, boot into Active Directory Services Restore Mode, make sure that your networking changes are set properly, and that your DNS server has it’s forwarders set up right. This is a good way to check the base level of your server’s health, then bring it back online to try to log into AD.
- There’s no reason to need to rebuild the server, but if it’s a small enough location (AD doesn’t change very often, or if it does, the changes are minor), and you have good backups, take a look at how long this is taking you, and how much longer you’ll spend attempting to fix the problem. Going back to the backup from the previous night and restoring ONLY the system state in Directory Services Restore Mode might be the fastest and best solution. Then you can follow the steps in here in order, and grow fewer ulcers.
Next week sometime I’ll do a similar version for multi-DC, multi-Site AD networks – it’s a lot shorter and easier.
February 1st, 2008 at 9:55 am
I think that was a great article. I wish it did have a view screen shots though. I have very similar scenario and I think I need some help. I just started at a new company and they are moving into a brand new building and seperating into two seperate companies the orginal company in the old building and the new company in the new building. They also want to change a bunch of stuff but still have the two companies linked together. Currently we have 8 servers running a multiple of things. However we have spent a ton of money buying a new rack system with 4 blades and two more coming to take over the old servers. The main thing is the IP address sceme. They want to get away from the 179.26.x.x ip and go with 172.20.x.x. I think I understand how to do that on the server side but they are also wanting to change the domain name as well. My question is how and where do I start? Create a new domain under blank.com and join the new servers to that domain with the new IP sceme. Then what setup a trust between the two domains? What about the VPN tunnel between the two buildings? There is alot to think about but I just need to know the steps I need to take. What to do first through the last step. I can research the steps if you can help me identify them.
March 23rd, 2008 at 4:18 am
Hello everybody, my name is Damion, and I’m glad to join your conmunity,
and wish to assit as far as possible.
July 10th, 2008 at 8:42 am
Hello, i think this a great information, bu ti need you to please cover another case, that is, when you dont want to change your ip, and just want to add a new subnet, because your scopes are already full. In this moment i have that problem, i mean, i add a new subnet, add the reverse zone, and create the new scope, but i cannot ping my dc. Thanks a lot for everithing
July 13th, 2008 at 12:07 pm
David, It sounds like you’re actually having a routing problem and need to add a router to your network. Let’s say your Domain controller is 192.168.1.10 with a subnet mask of 255.255.255.0 and a gateway of 192.168.1.1. That means that every device with an address of “192.168.1.x” is physically connected to the same LAN. If your new DHCP scope is 192.168.2.x/255.255.255.0, then your domain controller thinks that it needs to send packets to those computers via the router at 192.168.1.1. Those computers are doing the same thing – sending traffic for 192.168.1.10 via 192.168.2.1, which you probably didn’t create.
I don’t recommend creating Windows networks with more than 250 hosts generally, but that’s the easiest way to solve this problem – just change the subnet mask on all your servers (and in the DHCP scope) from 255.255.255.0 to 255.255.254.0 or 255.255.252.0 (254 allows 192.168.1.0 and 192.168.0.0, 252 allows 192.168.0.0 through 192.168.3.255). However, you will start to see network slowdowns due to all the broadcast traffic for SMB, if you’re not using WINS with your Windows XP / Windows 2000 / older clients.
The better option is to set up a new router, or buy something like a Dell, Linksys, Dlink “small business layer 3 switch.” Either of these options requires you to actually set up routes in your environment – if you’d like, contact us back, and we can assist with this more advanced, and better long-term, solution, including basic training.
August 26th, 2008 at 12:09 pm
Hi Robert
I have a different question. We host our own website. We do not have firewall. Users from the public internet can access our website, but internally we can’t access it. Even by IP it sometimes works and other times not. I am pretty sure its a dns issue but I just can’t put my finger on it.
Do you have any siggestions for me?
Thanks
August 31st, 2008 at 2:43 am
I do not believe this
September 5th, 2008 at 1:59 am
Karl,
This is a split-brain DNS problem. Most likely you just need to go home, do a “nslookup http://www.yourdomain.com“, save the IP, and go back to work. in the office, create an “A” record called “www” with the IP you found from home, and your problem should be solved. I’ll write a bit more about the “why” of this in the future. Hope that helps!
September 18th, 2008 at 1:09 pm
Great article!
But I have a question. We’re changing our IP scheme from 192.168.x.x AND 172.16.x.x to 10.222.x.x. Our network is behind a Watchguard Firebox firewall. At what point do I change/add the Gateway on the Firebox (firewall) unit so that users who will be on the new subnet can access the internet?
September 18th, 2008 at 11:21 pm
I would change the gateway any time after adding the new IP to the domain controller AND changing the DHCP scope, so that the clients have moved to the NEW IP and can talk to the DC. After testing, THEN I would remove the old IP from the DC. Hope that helps!
September 29th, 2008 at 1:05 am
Hi,
Fantastic articles- thanks!
We are just planning on changing our subnet mask- it’s currently 255.255.255.0 and we need more addresses on our static range. What’s the best way to do this?
Many thanks!
July 15th, 2009 at 10:41 pm
you can chk the ip details from http://whatismyipaddress.com/
September 7th, 2009 at 9:09 pm
harsh – you can check your public IP, but you should never have a domain controller with a public IP address directly assigned to it – securing such a system is much more difficult than simply not allowing any direct communications from the outside to your DC.
September 21st, 2009 at 3:54 am
Great article Robert but as you say, I’m “finding this after attempting…”.
We have a LAN of ~22 WinXP computers with a single Win2K Server DC acting as DHCP/DNS Server, File & Print Server. I finally buckled down last week to change over from public IP addresses (don’t ask
)to 192.168.11.0/24. I’d planned *most* of your points and found that I had no trouble connecting clients to the domain or to the Internet after the changes.
BUT I now find I have two WinXP clients which cannot access any resources on the File/Print Server: if I drill down through My Network Places to Microsoft Windows Network, the domain name appears but after an unusual delay; when I then click on the domain name I get “nnnn is not accessible. you might not have permission…. no path to network resource” where nnnn is the domain name.
I’ve already spent a “long day/night” fiddling with things, making sure the DC’s DHCP, DNS etc. is clean & correct… shutdown the two clients after connecting them to a DUMMY Workgroup, removed them from the DC’s DNS Forward Lookups, DHCP list and AD list of computers… followed by a fresh connect to the domain from each client which succeeds as normal.
The clients appear to be joining the domain just fine and can be seen in the domain browse list from the DC and other clients and can be connected to – they just cannot connect to the domain themselves. If I enter the domain name in an Explorer Address Box on the client I get the default content page for the HTTP Server on the DC.
Over the weekend it’s occurred to me that the common element here is that those two clients are the only ones which had/have printers attached (USB) which are shared and had entries in the Active Directory list.
I’m now hoping that if I remove those dangling(?) printer shares from AD it’s going to help. Other than that I’ll be following every clue in your article in detail to see what I might have missed, when I get to the office. If you have any thoughts or suggestions I’d appreciate hearing back. Thanks.
October 25th, 2009 at 2:49 pm
How do I telnet to an intel switch ? I am asked to list the ip address to got in the switch and don t have it .
It s an intel express 510 t
thanks , hope you can help.
john disano
Jdisano@hotmail.com
October 25th, 2009 at 2:51 pm
How do I telnet to an intel switch ? I am asked to list the ip address to got in the switch and don t have it .
It s an intel express 510 t
thanks , hope you can help.
john disano
Jdisano@hotmail.com or john.disano@ppsd.org
October 27th, 2009 at 2:17 pm
John,“. If the switch doesn’t respond to telnet, you may simply be able to access it via the web.
If you know the IP address of the switch, it’s likely to be listening on the standard telnet port, so from any OS, you should be able to open a terminal or command window and type “telnet
If you don’t know the IP address of devices on your network, something like nmap is a good tool for mapping devices on your network.
Rob
January 11th, 2010 at 12:28 pm
Hello Robert,
I’m happy I found this article, it’s very close to what I’m planning for my network. Actually, response #4 touches on what I would like to do.
I’ve got 3 subnets connected by VPN. 2 of the subnets are not very populated but the 3rd is near capacity. I have a lot of static addresses on that subnet and would like to increase the size of the subnet without changing any of them.
I have 192.168.5.0 /24 (has one DC)
192.168.3.0 /24 (has one DC)
and 192.168.1.0 /24 (has two DCs).
I’m considering changing the subnet mask of the 1.0 network and turning it into 192.168.0.0 /23.
My thinking behind this is that I won’t have to change the IPs of the servers and devices, just their subnet masks (aside from the necessary configuration changes to my firewall and to active directory). I can let a change in DHCP configuration take care of my client machines.
In the 5th step of the original article you discuss creating a new subnet in sites and services. So, I’m wondering if it’s possible to do what I’m suggesting. I’m not giving my DCs (or any of my other servers for that matter) different addresses, I just want to change the subnet mask. If it is possible, what steps would be different?
Thanks,
Thomas
February 26th, 2010 at 2:40 pm
Thomas: Sorry for the long delay – I’ve been very busy with several projects.
Just build a new subnet in the existing site (192.168.0.0/23) and delete the “192.168.1.0/24″ subnet. Nothing else needs to be changed (other than you’ve mentioned), since you’re not changing IPs.