How do I get the native IP address in Oracle and get the domain name based on the IP address?

Source: Internet
Author: User

-----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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.