debain 配置IP和DNS

来源:互联网 发布:磁盘修复软件 编辑:程序博客网 时间:2024/06/05 14:17

一、IP配置

通过编辑/etc/network/interfaces文件实现IP配置。

1. DHCP

auto eth0iface eth0 inet dhcp

2. 静态IP

auto eth0iface eth0 inet static        address 192.168.32.100        netmask 255.255.255.0        gateway 192.168.32.1

atuo eth0指定网卡,eth0为网卡名称,不同的机器可能不同,可以通过ifconfig命令查看:

ifconfig.png
具体address、netmask、gateway值根据实际情况来配置,或者咨询网络管理员。

二、 DSN配置

编辑/etc/resolv.conf文件

nameserver 114.114.114.114nameserver 8.8.8.8
原创粉丝点击