Debian靜態IP位址和DNS

2021-09-07 15:24:27 字數 1032 閱讀 4518

debian靜態ip位址和dns

一、配置檔案及路徑

/etc/network/inte***ces

二、ip位址

1. dhcp的ip配置如下

# the primary network inte***ce

allow-hotplug eth0

iface eth0 inet dhcp

2. 靜態的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

nameserver 8.8.8.8

有多個就新增多行。

2.如果安裝了resolvconf

接著在gateway的下面一行新增(注意是/etc/network/inte***ces這個檔案)

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

2311:52:23 cst 2017

;; msg size rcvd:

239

systemctl restart networking

debian 修改ip位址

debian的ip位址資訊的檔案是儲存在 etc network inte ces,直接編輯該檔案就可以。可以看到檔案中的設定為動態ip的語句 iface eth0 inet dhcp 當然也可以設定為靜態ip位址,如 在 etc network inte ces 中,刪除 iface eth0 i...

debian配置靜態ip

系統 debian 8.5 子網掩碼 255.255.255.0 閘道器 10.50.200.254 dns 219.147.1.66 8.8.8.8 操作 1 設定ip位址 閘道器 etc network inte ces etc network inte cesbak 備份原有配置檔案 etc ...

設定debian的靜態IP

例如想要設定網路的資訊如下 子網掩碼 255.255.255.0 閘道器 10.10.10.2 dns 10.10.10.2,114.114.114.114 我們需要編輯2個檔案 etc network inte ces 配置ip和閘道器 etc resolv.conf 配置dns伺服器 先vi e...