linux系统里面怎麼设置DNS

来源:百度知道 编辑:UC知道 时间:2024/05/22 00:56:35
我现在在虚拟机里面装了个redhat9,IP地址已经设置好了,内部网络可以ping通,但是不能访问外网,我的IP是可以连出去的,所以我估计是没有设置DNS的原因,请教各位:我应该怎麼样来设置呢?

1。从安装盘安装

rpm -ivh bind-9.2.2-21.i386.rpm

2。增加配置文件

vi /etc/named.conf

## named.conf - configuration for bind # # Generated automatically by redhat-config-bind, alchemist et al. # Any changes not supported by redhat-config-bind should be put # in /etc/named.custom # controls { inet 127.0.0.1 allow { localhost; } keys { rndckey; }; }; include "/etc/rndc.key";

options {

directory "/var/named/";

};

zone "." {

type hint;

file "named.ca";

};
zone "0.0.127.in-addr.arpa" {

type master;

file "0.0.127.in-addr.arpa.zone";

};
zone "localhost" {

type master;

file "localhost.zone";

};
zone "5ilinux.com" {

type master;

file "5ilinux.com.zone";

};

vi /var/name