The issue you are having is nothing to do with the IP, it is because you have 2 machines with the same name. You can only have one AD computer object for a machine name and this computer object has a password, this password is negotiated between the DC and the Computer when you join it to the domain, it's not something you enter it's configured by the domain.
When you swap out the machine for another with the same name then you get this issue. This new machine does not know the password that has been negotiated and the DC won't trust it.
There are a couple of ways to resolve it. One way is to remove and re-join the machine from the domain, this will recreate the trust. Another is to run one of the following commands:
Powershell
Reset-ComputerMachinePassword -Server <Name of any domain controller> -Credential <domain admin account>
Command Line
NETDOM RESETPWD /Server:<name of any domain controller> /UserD:<domain admin account> /PasswordD:*
Either method requires you to be able to logon with a local admin account (or cached credentials).
This issue is going to occur every time you do this, so I would advise you avoid having 2 machines with the same name. If you need to swap them around, give them different machine names and setup a CNAME to point to the appropriate live server.
Edit for more info
If we say the old working machine is machine A, and the new one Machine B. Machine A and the domain have negotiated a password when you joined it to the domain, nothing to do with any of your passwords, you have no involvement. Both Machine A and the domain know this password and whenever machine A communicates with the domain it passes this and authenticates. All is well.
When you disconnect Machine A and Join Machine B, Machine B tries to talk to the domain, but it has no idea what password Machine A and the domain agreed on, so it fails and there is no trust. The only way to get them to trust again is to get them to negotiate a new password, but you have to force this using one of the commands I mentioned, or by removing and rejoining the domain. All of these require the user to have the rights to add domain computes, it would be no good if you could just restart the machine and it work else anyone could add a rouge machine to the domain and get access to the network. The commands I mentioned only need to be run on the machine that has the issue, it basically says to the domain that it needs to recreate the password with this machine, and here are my credentials to prove it is OK.
However, as I mentioned this will happen every time you swap machines. This is not a good idea as a permanent solution.