-----Resolving IP Addresses
Sql> Select Utl_inaddr.get_host_address (' google.com ') from dual;
Utl_inaddr. Get_host_address (' google.com ')
--------------------------------------------------------------------------------
122.229.30.202
-----Get the native IP address
Sql> select utl_inaddr.get_host_address from dual;
Get_host_address
--------------------------------------------------------------------------------
10.80.18.241
-----Reverse-Parse hostname based on IP address
Sql> Select Utl_inaddr.get_host_name (' 10.80.18.241 ') from dual;
Utl_inaddr. Get_host_name (' 10.80.18.241 ')
--------------------------------------------------------------------------------
Lixora
Sql> Select Utl_inaddr.get_host_name (' 10.80.18.243 ') from dual;
Utl_inaddr. Get_host_name (' 10.80.18.243 ')
--------------------------------------------------------------------------------
Oracle11g-dagi
Sql> Select Utl_inaddr.get_host_name (' 8.8.8.8 ') from dual;
Utl_inaddr. Get_host_name (' 8.8.8.8 ')
--------------------------------------------------------------------------------
Google-public-dns-a.google.com
Sql> Select Utl_inaddr.get_host_name (' 10.80.18.210 ') from dual;
Select Utl_inaddr.get_host_name (' 10.80.18.210 ') from dual
*
ERROR at line 1:
Ora-29257:host 10.80.18.210 Unknown
Ora-06512:at "SYS. Utl_inaddr ", line 4
Ora-06512:at "SYS. Utl_inaddr ", line 35
Ora-06512:at Line 1
Sql> Select Utl_inaddr.get_host_name (' 10.80.19.210 ') from dual;
Select Utl_inaddr.get_host_name (' 10.80.19.210 ') from dual
*
ERROR at line 1:
Ora-29257:host 10.80.19.210 Unknown
Ora-06512:at "SYS. Utl_inaddr ", line 4
Ora-06512:at "SYS. Utl_inaddr ", line 35
Ora-06512:at Line 1
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
How do I get the native IP address in Oracle and get the domain name based on the IP address?