Fully redirect domain to the new IP

has any of you already redirected one domain to the newly added IP?

The domain itself responds correctly via DIG from the newly added IP - but I would like this particular domain, when I use for example, CURL from CLI or CURL from PHP script, that it would also use this new IP.

Any solutions?

It sounds like you mix here something. Domains are related to dns which points it to the ip. Based on the TTL, a ip change can take a long time to switch from old to new. An option would be to lower the TTL, wait the old TTL, switch the IP and increase the TTL.

So in your case, if dig (or a ping) points you to the right ip, it should count aswell for every other service like curl or php.

Maybe I also missunderstand your request, then it would be good to add a few more informations :slight_smile:.

1 Like

I try my best to clarify what I need :slight_smile:

I add in the network settings HestiaCP new adress IP -> I change the IP in the site settings in HestiaCP -> then I point in my DNS domain to the new IP.

And now domain work properly from the new adress IP.

But also I need use this new IP in outgoing connection, for example in Curl etc. Now CURL still use the „system” IP and I dont know exacly how I Can switch this IP only for this one domain also in Curl connection.

For example my dear’s.

Domain correct poiting to the new IP : via DIG etc.

But when I execute the CURL :
[email protected]:~# curl ifconfig.me
[email protected]:~#

I think now it’s clear :smiley:

This is more a network related issue than hestia. You probaly still have configured your old IP as main ip in your network configuration. If you run a curl, the command comes from your cli and doesnt know which ip he should try to use as sender, it just takes the system default.

So if you want to completly change your ip to the new one, you need to rework your network config.

1 Like

Yeah, maybe I find solution : Change Main IP of the server :: Vesta Panel - Vidensdatabase - HostSailor

or How to Auto Change IP Address in VestaCP - Vesta Control Panel - Forum

but this is change for the server IP, not per domain.

Maybe it’s good idea create a guide for HestiaCP on how to change the IP address for a server or a domain. I will try with this two tutorial. Thank’s! :smiley:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.