This document describes how to obtain the private IP address of the instance and configure the private DNS.
Please see DescribeInstances API.
Execute the following command to obtain the private IP.The following operations use the cURL tool as an example.
curl http://metadata.tencentyun.com/meta-data/local-ipv4
The returned information is the private IP address, as shown below:
For more information about instance metadata, see Instance Metadata.
When a network resolution error occurs, you can manually configure the private network DNS based on your CVM operating system.
Log into the Linux CVM.
Execute the following command to open the /etc/resolv.conf
file.
vi /etc/resolv.conf
Press i to switch to the edit mode, and modify the DNS IP according to the corresponding region in the Private Network DNS list.
For example, to change the private network DNS IP to an private network DNS server in the Beijing region.
nameserver 10.53.216.182
nameserver 10.53.216.198
options timeout:1 rotate
Press Esc, enter :wq, save the file and return.
Log in to the Windows CVM.
On the operating system interface, open Control Panel > Network and Sharing Center > Change adapter settings.
Right-click the Ethernet and select Properties to open the “Ethernet Properties” window.
In the “Ethernet Properties” window, double-click Internet Protocol Version 4 (TCP/IPv4).
Select Use the following DNS server addresses and modify the DNS IP according to the corresponding region in the Private Network DNS list.
Click OK.
Was this page helpful?