Help & DocumentationCloud Virtual MachineOperation GuideInstancesManagement instance IP addressObtaining the Private IP Address of an Instance and Private Network DNS Settings

Obtaining the Private IP Address of an Instance and Private Network DNS Settings

Last updated: 2020-04-01 21:50:59

PDF

Obtaining the private IP address of an instance

Obtaining the Address on the Console

  1. Log in to the CVM Console.

  2. 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

  1. Log in to the CVM instance. For more information, please see Log in to Linux Instance and Log in to Windows Instance.

  2. Enter the command:

    curl http:https://metadata.tencentyun.com/meta-data/local-ipv4

    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.conf file 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.