To configure the intranet DNS of a cloud server, follow these steps:
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).
Edit the Network Configuration File:
/etc/resolv.conf (temporary) or use netplan/NetworkManager for persistent changes.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
Test the Configuration:
Use nslookup or dig (Linux) to verify DNS resolution.
Example:
nslookup internal-service.example.com
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.