博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Debian静态IP地址和DNS
阅读量:7082 次
发布时间:2019-06-28

本文共 680 字,大约阅读时间需要 2 分钟。

Debian静态IP地址和DNS

一、配置文件及路径

/etc/network/interfaces

二、IP地址
1. DHCP的IP配置如下

# The primary network interfaceallow-hotplug eth0iface eth0 inet dhcp

2. 静态的IP配置示例如下

allow-hotplug eth0iface eth0 inet staticaddress 192.168.11.100netmask 255.255.255.0gateway 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 dnsutils

1.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: 239

SERVER:这一行就是配置生效的DNS地址

五、网卡重启

systemctl restart networking

 

转载地址:http://bplml.baihongyu.com/

你可能感兴趣的文章
「POJ3734」Blocks
查看>>
Beta 冲刺 (4/7)
查看>>
CSS3
查看>>
VGG16提取图像特征 (torch7)
查看>>
Python 远程部署 Fabric
查看>>
1013A.Piles With Stones
查看>>
multipart/form-data和application/x-www-form-urlencoded的区别
查看>>
php 搜索附近人及SQL语句的写法
查看>>
拖拽(兼容版)
查看>>
Python中and和or的运算法则
查看>>
Raspberry Pi使用USB摄像头远程监控
查看>>
Ruby-selenium-webdriver(安装准备篇)
查看>>
今天愣了半天硬是没想到用map,在此还原以下代码
查看>>
【转】UITableViewCell自适应高度 UILabel自适应高度和自动换行
查看>>
网络问卷调查js实现代码
查看>>
mark住先
查看>>
mysql事物处理
查看>>
c++中的基本知识点
查看>>
一些js在线引用文档
查看>>
关键路径
查看>>