Linux修改dns域名配置
#!/bin/bash #1.定义DNS的文件 libin1="/etc/resolv.conf" #2.备份原来的DNS文件 cp $libin1 "$libin1".bak #3.定义需要修改的DNS dns1="211.142.211.124" dns2="111.8.14.18" #4.修改配置 echo "nameserver " $dns1>$libin1 echo "nameserver " $dns2>>$libin1
#!/bin/bash #1.定义DNS的文件 libin1="/etc/resolv.conf" #2.备份原来的DNS文件 cp $libin1 "$libin1".bak #3.定义需要修改的DNS dns1="211.142.211.124" dns2="111.8.14.18" #4.修改配置 echo "nameserver " $dns1>$libin1 echo "nameserver " $dns2>>$libin1