Assume we have two servers A and B with 'real' and external IPs and we can switch the so called 'failover ip' (W.X.Y.Z) to point to a specific external IP of A or B. This works from the 'outside' and was easily done. As a background: the failover ip is configured as a new entry in /etc/network/interfaces :
auto eth0:0
iface eth0:0 inet static
address W.X.Y.Z
netmask 255.255.255.224
Now let us assume W.X.Y.Z is configured dynamically to use hardware A. Now I call 'curl domain.com' from B and it uses the correct failover ip W.X.Y.Z but then resolves somehow to the wrong external IP B (or localhost?) instead of using the configured one A:
Trying W.X.Y.Z ...
* connect to W.X.Y.Z port 443 failed: Connection refused
* Failed to connect to domain.com port 443: Connection refused
* Closing connection 0
curl: (7) Failed to connect to domain.com port 443: Connection refused
When I start the local nginx it can successfully curl domain.com
Do I need to configure DNS locally somehow? How can I find out more about the DNS chain?
Using mtr just prints domain.com if trying this from server B
Is this related to this question?
The failover IP is W.X.Y.Z and is also the A record of domain.com
The /etc/hosts file for both nodes serverA and serverB looks like:
127.0.0.1 localhost
127.0.1.1 luminarhost
xxx serverA
xxx serverB
The /etc/network/interfaces of serverA
### Hetzner Online AG - installimage
# Loopback device:
auto lo
iface lo inet loopback
# device: eth0
auto eth0
iface eth0 inet static
address xxx
broadcast xxx
netmask xxx
gateway xxx
# default route to access subnet
up route add -net xxx netmask 255.255.255.224 gw xxx eth0
iface eth0 inet6 static
address xxx
netmask xxx
gateway xxx
# failover ip
auto eth0:0
iface eth0:0 inet static
address W.X.Y.Z
netmask 255.255.255.224
and of serverB it is:
### Hetzner Online AG - installimage
# Loopback device:
auto lo
iface lo inet loopback
# device: eth0
auto eth0
iface eth0 inet static
address xxx
broadcast xxx
netmask xxx
gateway xxx
# default route to access subnet
up route add -net xxx netmask 255.255.255.192 gw xxx eth0
iface eth0 inet6 static
address xxx
netmask xxx
gateway xxx
# failover ip
auto eth0:0
iface eth0:0 inet static
address W.X.Y.Z
netmask 255.255.255.224