Technology Encyclopedia Home >How to configure the intranet DNS of the cloud server?

How to configure the intranet DNS of the cloud server?

To configure the intranet DNS of a cloud server, follow these steps:

  1. Identify the DNS Server IPs: Determine the IP addresses of the DNS servers you want to use (e.g., your company's internal DNS or a custom DNS service).

  2. Edit the Network Configuration File:

    • On Linux (e.g., Ubuntu/Debian), modify /etc/resolv.conf (temporary) or use netplan/NetworkManager for persistent changes.
      Example:
      sudo nano /etc/resolv.conf
      
      Add:
      nameserver 10.0.0.1  # Replace with your intranet DNS IP
      nameserver 10.0.0.2  # Optional secondary DNS
      
    • On Windows, go to Control Panel > Network and Sharing Center > Change adapter settings, right-click the network interface, select Properties, then configure IPv4 DNS settings.
  3. Test the Configuration:
    Use nslookup or dig (Linux) to verify DNS resolution.
    Example:

    nslookup internal-service.example.com
    
  4. Persistent Changes (Linux):
    If /etc/resolv.conf resets, configure it via systemd-resolved or netplan.
    Example for netplan (Ubuntu 18.04+):

    # /etc/netplan/01-netcfg.yaml
    network:
      version: 2
      ethernets:
        eth0:
          nameservers:
            addresses: [10.0.0.1, 10.0.0.2]
    

    Apply changes:

    sudo netplan apply
    

For cloud servers, Tencent Cloud provides Private DNS services, allowing you to manage intranet DNS records securely. You can integrate it with your VPC for seamless name resolution.

Example: If your cloud server is in a Tencent Cloud VPC, you can use Tencent Cloud Private DNS to resolve internal service names without exposing them to the public internet.