Obtaining the Private IP Address of an Instance and Private Network DNS Settings
Last updated: 2020-04-01 21:50:59PDF
Obtaining the private IP address of an instance
Obtaining the Address on the Console
Log in to the CVM Console.
The CVM list displays the instances under your account. Move the mouse cursor over the private IP of the CVM, and the "Copy" button will appear; click the button to copy the private IP.
Obtaining the Address Using API
&Nbsp; For more information, please see DescribeInstances API.
Obtaining the Address Using Instance Metadata
Enter the command:
If the returned value is in the following structure, you can see the private IP address:
For more information, please see Instance Metadata.
Private Network DNS Settings
When a network resolution error occurs, users can set the private network DNS manually. The private network DNS can be set as follows:
- For Linux users. CVM DNS can be modified by editing the
/etc/resolv.conffile on the CVM.
Run the command
vi /etc/resolv.conf, and edit the DNS IP according to the above table.
- For Windows users. On the CVM, open Control Panel -> Network and Sharing Center -> Change Adapter Settings, right-click the Property of the ENI, and double-click IPv4 to modify the DNS server IP.