Debian静态IP地址和DNS | 您所在的位置:网站首页 › debian10设置固定ip › Debian静态IP地址和DNS |
Debian静态IP地址和DNS 一、配置文件及路径 /etc/network/interfaces二、IP地址1. DHCP的IP配置如下 # The primary network interface allow-hotplug eth0 iface eth0 inet dhcp2. 静态的IP配置示例如下 allow-hotplug eth0 iface eth0 inet static address 192.168.11.100 netmask 255.255.255.0 gateway 192.168.11.1三、关于DNS配置1.DNS配置文件地址 /etc/resolv.conf添加实际的dns地址: nameserver 8.8.8.8有多个就添加多行。 2.如果安装了resolvconf接着在gateway的下面一行添加(注意是/etc/network/interfaces这个文件) dns-nameservers 8.8.8.8四、查看使用中的DNS配置1. dig命令1.1 安装dig sudo apt-get install dnsutils1.2 执行dig ;; Query time: 2 msec ;; SERVER: 127.0.1.1#53(127.0.1.1) ;; WHEN: Mon Oct 23 11:52:23 CST 2017 ;; MSG SIZE rcvd: 239SERVER:这一行就是配置生效的DNS地址 五、网卡重启 systemctl restart networking
|
CopyRight 2018-2019 实验室设备网 版权所有 |