In oracle, how does one obtain the local IP address and the domain name based on the IP address ?, Oracleip

Source: Internet
Author: User

In oracle, how does one obtain the local IP address and the domain name based on the IP address ?, Oracleip
----- Resolve the ip address
SQL> select utl_inaddr.get_host_address ('Google. com') from dual;

UTL_INADDR.GET_HOST_ADDRESS ('Google. com ')
--------------------------------------------------------------------------------
122.229.30.202


----- Obtain the local IP Address
SQL> select utl_inaddr.get_host_address from dual;
GET_HOST_ADDRESS
--------------------------------------------------------------------------------
10.80.18.241



----- Reverse resolution of the host name based on the 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 Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

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.