linux设置
来源:互联网 发布:淘宝宝贝销售属性出错 编辑:程序博客网 时间:2024/05/20 12:46
linux设置DNS方法文章分类:操作系统
[问题描述 ]Linux下如果ping一个域名,出现如下状况:#ping www.taobao.comping: unknown host www.taobao.com 那是因为系统没有设置DNS的缘故。在此场景下,任何通过域名的操作都会有问题。
[解决办法 ]
1、查看DNS设置
#cat /etc/resolv.conf
如果能看到 nameserver xxx.xxx.xxx.xxx说明DNS已经设置,这时要考虑设置的DNS对否。
2、设置DNS直接编辑 /etc/resolv.conf 即可
添加正确的DNS 地址. 如下:
nameserver xxx.xxx.xxx.xxx
重启网络服务的命令是service network restart或者/etc/init.d/network restart
进入
/etc/sysconfig/network-script/
用vi编辑器打开文件。
ifcfg-eth0
进行编辑
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0c:29:da:1b:8a
ONBOOT=yes
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=192.168.1.10
USERCTL=no
PEERDNS=yes
GATEWAY=192.168.1.253
IPV6INIT=no
然后保存
进入/etc/目录下面
找到
resolv.conf文件
使用vi编辑器打开
servername 172.16.4.37(DNS地址)
保存
重启网络服务
/etc/init.d/network restart
- linux设置
- linux设置
- Linux-----Linux设置环境变量
- linux设置环境变量设置环境变量
- 【Linux】Linux下设置环境变量
- Linux曲径通幽:Linux网络设置
- linux常用设置
- linux中设置组
- Linux 远程桌面设置
- Linux下设置网卡
- 设置linux缺省语言
- linux 网络设置
- Linux iptables 设置
- Linux服务设置方法
- Linux安全设置
- linux输入法的设置
- linux的安全设置
- linux vmware上网设置
- 索引创建和使用
- AJAX攻击
- AddRange 取代 Add
- 十九:VC中利用多线程技术实现线程之间的通信
- 关于线性互补定理
- linux设置
- linux bonding译文
- Install software in Unbuntu
- Eclipse error: The type java.lang.Object cannot be resolved. It is indirectly referenced from the required .class files
- DirectSound应用
- query ajax xml 实例
- C语言结构体和联合体
- vector , list 和 deque的优缺点
- C语言结构体和联合体