# UAAA Domain Acceleration Product DNS Configuration Guide

## I. Configuration Background
The UAAA domain acceleration product provides optimized resolution services through an independent DNS server, enhancing domain resolution efficiency and stability. Before use, the default DNS of the cloud host needs to be pointed to a specific DNS resolution server to enable acceleration. Below are the specific configuration steps for cloud hosts on various operating systems.

## II. DNS Server Addresses
Please change the default DNS of the cloud host in the private network to the following addresses (it is recommended to prioritize the first one):
```Plain
100.90.90.90
100.90.90.100
```

## III. DNS Modification Methods for Different Operating Systems

### **Rocky Linux / CentOS (including CentOS6/7/8)**

1. Temporary DNS Modification (effective immediately, will be lost after restart)

```Plain
sudo vim /etc/resolv.conf
```

Delete the original nameserver lines and add the following:
```Plain
nameserver 100.90.90.90
nameserver 100.90.90.100
```

Save and exit  

2. Persistent Configuration (retained after restart)

```Plain
sudo vim /etc/sysconfig/network-scripts/ifcfg-<interface-name>  # e.g., ifcfg-eth0 or ifcfg-ens33
```
Modify the following fields (add if they don't exist):
```Plain
DNS1=100.90.90.90  
DNS2=100.90.90.100  
```
Replace DNS1/DNS2 in the original configuration with the specified addresses, save and exit, then restart the network service:
```Plain
sudo systemctl restart network  
```
Once the restart completes, it will take effect.

### **Ubuntu (including 20.04/22.04/24.04)**

1. Temporary DNS Modification (effective immediately, will be lost after restart)

```Plain
sudo vim /etc/resolv.conf
```

Delete the original nameserver lines and add the following:
```Plain
nameserver 100.90.90.90
nameserver 100.90.90.100
```

Save and exit  

2. Persistent Configuration (retained after restart)

Open the configuration file:
```Plain
sudo vim /etc/netplan/50-cloud-init.yaml
```
Locate the nameservers: section and modify it to:  
```Plain
nameservers:
  addresses: [100.90.90.90, 100.90.90.100]  
```
Save and exit, then apply the configuration immediately:
```Plain
sudo netplan apply 
``` 

Once the restart completes, it will take effect.

### **Ubuntu (including 14.04/16.04/18.04)**

1. Temporary DNS Modification (effective immediately, will be lost after restart)

```Plain
sudo vim /etc/resolv.conf
```

Delete the original nameserver lines and add the following:
```Plain
nameserver 100.90.90.90
nameserver 100.90.90.100
```

Save and exit  

2. Persistent Configuration (retained after restart)

**Non-cloud-init Startup Management**

```Plain
sudo vim /etc/network/interfaces
```
Locate the dns-nameservers line for eth0 and modify it to:  
```Plain
dns-nameservers 100.90.90.90 100.90.90.100  
```

Save and exit, then restart the network service: 
```Plain
sudo /etc/init.d/networking restart 
``` 
Once the restart completes, it will take effect.

**Cloud-init Managed Startup**

```Plain
sudo vim /etc/network/interfaces.d/50-cloud-init.cfg 
```
Modify the dns-nameservers field to:
```Plain
dns-nameservers 100.90.90.90 100.90.90.100  
```
Save and exit, then restart the network service: 
```Plain
sudo systemctl restart networking.service 
``` 
Once the restart completes, it will take effect.

### **Debian (including 8/9/10)**

1. Temporary DNS Modification (effective immediately, will be lost after restart)

```Plain
sudo vi /etc/resolv.conf
```

Delete the original nameserver lines and add the following:
```Plain
nameserver 100.90.90.90
nameserver 100.90.90.100
```

Save and exit  

2. Persistent Configuration (retained after restart)

**Non-cloud-init Startup Management**

```Plain
sudo vi /etc/network/interfaces
```
Locate the dns-nameservers line for eth0 and modify it to:  
```Plain
dns-nameservers 100.90.90.90 100.90.90.100  
```
Optionally, retain public DNS (e.g., 114.114.114.114) as a backup:
```Plain
dns-nameservers 100.90.90.90 100.90.90.100 114.114.114.114  
``` 

Save and exit, then restart the network service: 
```Plain
sudo systemctl restart networking  
``` 
Once the restart completes, it will take effect.

**Cloud-init Managed Startup**

```Plain
sudo vi /etc/network/interfaces.d/50-cloud-init
```
Modify the dns-nameservers field to:
```Plain
dns-nameservers 100.90.90.90 100.90.90.100  
```
Optionally, retain public DNS (e.g., 114.114.114.114) as a backup:
```Plain
dns-nameservers 100.90.90.90 100.90.90.100 114.114.114.114  
``` 

Save and exit, then restart the network service: 
```Plain
sudo systemctl restart networking 
``` 
Once the restart completes, it will take effect.

**Using systemd-resolved (default for Debian 9/10)**
Disable automatic management of resolv.conf
```Plain
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
```
Edit the systemd-resolved configuration
```Plain
sudo vi /etc/systemd/resolved.conf
```
Add to the [Resolve] section:
```Plain
DNS=100.90.90.90 100.90.90.100
FallbackDNS=114.114.114.114
```
Save and exit, then restart the network service: 
```Plain
sudo systemctl restart systemd-resolved
```
Once the restart completes, it will take effect.

### **Redhat 6.X**

1. Temporary DNS Modification (effective immediately, will be lost after restart)

```Plain
sudo vim /etc/resolv.conf
```

Delete the original nameserver lines and add the following:
```Plain
nameserver 100.90.90.90
nameserver 100.90.90.100
```

Save and exit  

2. Persistent Configuration (retained after restart)

```Plain
sudo vim /etc/sysconfig/network-scripts/ifcfg-eth0
```

Locate the dns-nameservers line for eth0 and modify it to:  

```Plain
DNS1=100.90.90.90
DNS2=100.90.90.100 
```

Save and exit, then restart the network service: 

```Plain
sudo service network restart 
``` 
Once the restart completes, it will take effect.

### **Windows (including 2008/2012/2016)**

1. Right-click on start and select network connections.

<!-- image-todo -->

2. Right-click on Ethernet and select Properties.

<!-- image-todo -->

3. Select Internet Protocol Version4 (TCP/IPv4), and modify the Preferred DNS server and Alternate DNS server.

<!-- image-todo -->

4. Click OK to apply the changes.

## IV. Verify Configuration Effectiveness
After configuration, you can verify whether the DNS is effective through the following commands:

- Linux/macOS: nslookup [your-domain.com](http://your-domain.com/) to check if the resolution server is `100.90.90.90` or `100.90.90.100`.

- Windows: Run nslookup in the command prompt, enter the domain name, and check the "Server" field.

**Precautions**:

- Some cloud providers may restrict DNS modification, ensure that the network card configuration file permissions are correct (e.g., ifcfg-eth0 file is writable).