tencent cloud

Feedback

Getting Private IP Addresses and Setting DNS

Last updated: 2024-01-08 09:32:02

    Overview

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

    Directions

    Obtaining the private IP address of an instance

    Obtain in console
    Obtain via API
    Obtain via instance metadata
    1. Log in to the CVM console.
    2. On the instance management page, proceed according to the actually used view mode:
    List view: select the target instance, move the cursor to the primary IP column, and click
    
    to copy the private IP as shown below:
    
    
    Tab view: on the instance page, click
    
    after the private network address in "IP Address" to copy the private IP as shown below:
    
    
    1. Log in to your CVM.
    2. Access the instance metadata by using the cURL tool or an HTTP GET request.
    Note:
    The following operations use the cURL tool as an example.
    Execute the following command to obtain the private IP.
    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 Querying Instance Metadata.

    Configuring private network DNS

    When a network resolution error occurs, you can manually configure the private network DNS based on your CVM operating system.
    Linux
    Windows
    1. Log into the Linux CVM.
    2. Execute the following command to open the /etc/grub.conf file.
    vi /etc/resolv.conf
    3. 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, 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
    4. Press Esc, enter :wq, save the file and return.
    1. Log in to the Windows CVM.
    2. On the operating system UI, open Control Panel > Network and Sharing Center > Change adapter settings.
    3. Right-click Ethernet and select Properties to open the "Ethernet Properties" window.
    4. In the "Ethernet Properties" window, double-click Internet Protocol Version 4 (TCP/IPv4) as shown below:
    
    
    5. Select Use the following DNS server addresses and modify the DNS IP according to the corresponding region in the Private Network DNS list.
    
    
    6. Click OK.
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support