SQLPlus configuration problem or firewall issue I need to connect to a remote Oracle DB, so I requested to open the firewall on the port 1521 to the DB and the replica.
[root@ansible-test ~]$ telnet &lt;oracle_db_active&gt; 1521
Trying &lt;oracle_db_active&gt;...
Connected to &lt;oracle_db_active&gt;.
Escape character is '^]'.

^CConnection closed by foreign host.

[root@ansible-test ~]$ telnet &lt;oracle_db_replica&gt; 1521
Trying &lt;oracle_db_replica&gt;...
Connected to &lt;oracle_db_replica&gt;.
Escape character is '^]'.

^CConnection closed by foreign host.

I'm able to telnet to the DB on port 1521.
But when I try to connect using SQLPlus I get an error as the host doesn't exist.
[root@ansible-test ~]$ echo exit |sqlplus &quot;&lt;user&gt;/&lt;pass&gt; @(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = &lt;oracle_db_active&gt;)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = &lt;oracle_db_replica&gt;)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = &lt;service&gt;)(FAILOVER_MODE = (TYPE = SELECT)(METHOD = BASIC)(RETRIES = 12)(DELAY = 5))))&quot;

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Sep 7 17:37:23 2020
Version 19.8.0.0.0

Copyright (c) 1982, 2020, Oracle.  All rights reserved.

ERROR:
ORA-12545: Connect failed because target host or object does not exist


Enter user-name: Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified

I have another server in the same network as the DB and I'm able to connect with the same string.
I don't have an sql.ora or tnsname.ora configure on any of the servers.
The only difference between the two servers is that one is RedHat and the other centos.
Do I need to open any other port to the DB o it is a configuration issue?
Thanks
(sorry for all the redacting)
I end up finding the answer :)
On my test server on the same network as the DB I made a tcpdump and I notice that my connection started on the primary IP and the DB reply through the secondary IP. There was a request on the DNS server in the middle.
I made the same test on my ansible-test server and found out that there was problem on then DNS request and fail the connection. Basically, it was not able to understand the secondary IP name.
So this end up being a weird networking problem.
Thanks All.