Live Chat Software by Kayako
Knowledgebase: Network Configuration
How do I configure my static DNS in interfaces?
Posted by Thang Le Toan on 29 April 2017 01:45 AM

 

 

I am using Ubuntu 12.04.

My /etc/network/interfaces file consists of:

# The loopback network interface  
auto lo  
iface lo inet loopback  


# The primary network interface  
auto eth0 
iface eth0 inet static  
address 192.168.1.58  
gateway 192.168.1.1
network 192.168.1.0  
broadcast 192.168.1.255
dns-nameservers 66.212.63.228 66.212.48.10  

I ran the command: /etc/init.d/networking restart

==============================

Next I ran ping google.com and received:

ping: unknown host google.com

I am not sure if my interfaces refreshed. How do I properly configure my network with my static DNS addresses?

--------------------------------------------

Trả lời:

 Việc sửa file nội dung cấu hình hiện nay chỉ cần sửa ở file (interface  không cần sửa ở file /etc/resolv.conf)

sudo gedit /etc/networks/interface

# The primary network interface  
auto eth0 
iface eth0 inet static  
address 192.168.1.160  
gateway 192.168.1.1
network 192.168.1.0  
broadcast 192.168.1.255
dns-nameservers 192.168.1.2 8.8.8.8  

Khi đã khai dns-nameservers 2 ip 192.168.1.2 và 8.8.8.8
thì cấu hình nội dung file: /etc/resolv.conf tự động cập nhật thành
nameserver 192.168.1.2
nameserver 8.8.8.8


 

(0 vote(s))
Helpful
Not helpful

Comments (2)
Ha Lan
19 July 2018 10:40 AM
/etc/network/interfaces:
auto eth0
iface eth0 inet static
address 192.168.0.201
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
dns-nameservers 10.10.10.1 8.8.8.8
Le Anh Ha Lan
30 January 2020 03:41 AM
How to List UP/Down Network interface:
ip a
How to Enable Network Interface:
ip link set ens160 up
How to Disable Network Interface:
ip link set ens192 down
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Kayako