Tenant Cloud Compute Cloud Virtual Machine Operation Guide Getting the Private IP Address and Setting DNS

Getting the Private IP Address and Setting DNS

Last Updated At: 2025-11-12 11:08:30

This document describes how to obtain the private IP address of the instance and how to set private network DNS.

Obtain the Private IP Address of the Instance

Using Console to Obtain

  1. Log in to the CVM console.
  2. On the Instance Management page, select the instance whose private IP address you want to view, move the mouse to the Primary IPv4 Address column, and will display.
  3. Click to copy the IP address.

Use Instance Metadata to Obtain

  1. Log in to the CVM.

  2. Use the CURL tool or GET requests of HTTP to access instance metadata.

    Note: The following operations take the cURL tool as an example.

    Execute the following command to obtain the private IP address.

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

    The returned information is the private IP address, as shown in the following figure:

For more information about instance metadata, see View Instance Metadata.

Set Private Network DNS

When network resolution errors occur, you can manually set private network DNS based on the type of CVM operating system.

Linux

  1. Log in to the Linux CVM.

  2. Execute the following command to open /etc/sysctl.conf file.

    vi /etc/resolv.conf
    
  3. Press i to switch to Edit mode, and modify DNS IP according to the corresponding region in the Private Network DNS list.
    For example, change the private DNS IP address to the private DNS server in City B region.

    nameserver 10.53.216.182
    nameserver 10.53.216.198
    options timeout:1 rotate
    
  4. Press Esc, enter :wq to save the file and return.

Windows

  1. Log in to the Windows CVM.
  2. In the operating system interface, open Control Panel > Network and Sharing Center > Change Adapter Devices.
  3. Right click Ethernet and select Attribute to open the Ethernet Attribute window.
  4. In the Ethernet Attribute window, double-click Internet Protocol Version 4 (TCP/IPv4).
  5. Select Use the Following DNS Server Address, and modify the DNS IP according to the different regions corresponding to the Private Network DNS list.
  6. Click OK.