導航:首頁 > 編程系統 > linux系統中配置dns

linux系統中配置dns

發布時間:2024-09-27 01:31:07

linux dnsconf命令詳解

linux系統下dnsconf命令用於設置DNS伺服器組態,是dnsconf命令內容的具體介紹:
1、dnsconf命令簡介:
linux系統下dnsconf命令用於設置DNS伺服器組態,dnsconf實際上為linuxconf的符號連接,提供圖形截面的操作方式,供管理員管理DNS伺服器。
2、語法:
dnsconf [--deldomain<域>][--delsecondary<域>][--newdomain<域>][--set<主機> ][--setcname <主機>][--setmx<域><主機>][--setns<域><主機>][--unset<主機>]3、參數:
--deldomain<域>刪除域。--delsecondary<域>刪除次級域。--newdomain<域>新增域。--set<主機>新增主機記錄。--setcname <主機>設置 。--setmx<域><主機>指定域的郵件主機。--setns<域><主機>指定域的DNS伺服器。--unset<主機>刪除DNS中某台主機的記錄。

⑵ linux下如何配置DNS伺服器,

在linux下配置DNS伺服器,下面是配置過程中設置過的一些文件

/etc/hosts 文件的具體內容如下:

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1 localhost.localdomain localhost fc4

192.168.1.3 a.test.com a

192.168.1.1 b.test.cn b

/etc/host.conf 文件:

order hosts,bind

表示先用hosts文件做解析,在用DNS解析

/etc/resolv.conf 文件:

; generated by NetworkManager, do not edit!

search test.com

nameserver 127.0.0.1

search test.cn

nameserver 192.168.1.1

nameserver 61.144.56.100

/etc/named.conf 文件:

//

// named.conf for Red Hat caching-nameserver

//

options {

directory "/var/named";

mp-file "/var/named/data/cache_mp.db";

statistics-file "/var/named/data/named_stats.txt";

/*

* If there is a firewall between you and nameservers you want

* to talk to, you might need to uncomment the query-source

* directive below. Previous versions of BIND always asked

* questions using port 53, but BIND 8.1 uses an unprivileged

* port by default.

*/

// query-source address * port 53;

};

//

// a caching only nameserver config

//

controls {

inet 127.0.0.1 allow { localhost; } keys { rndckey; };

};

zone "." IN {

type hint;

file "named.ca";

};

zone "test.com"IN {

type master;

file "test.com";

allow-update { none; };

};

zone "1.168.192.in-addr.arpa"IN {

type master;

file "192.168.1.rev";

allow-update { none; };

};

zone "test.cn"IN {

type master;

file "test.cn";

allow-update { none; };

};

zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {

type master;

file "named.ip6.local";

allow-update { none; };

};

zone "255.in-addr.arpa" IN {

type master;

file "named.broadcast";

allow-update { none; };

};

zone "0.in-addr.arpa" IN {

type master;

file "named.zero";

allow-update { none; };

};

include "/etc/rndc.key";

在/var/name/test.com 文件下:

$TTL 86400

@ IN SOA a.test.com. root.a.test.com (

42 ; serial (d. adams)

3H ; refresh

15M ; retry

1W ; expiry

1D ) ; minimum

IN NS a.test.com.

IN MX 10 mail.test.com.

a IN A 192.168.1.3

mail IN A 192.168.1.3

//其中root.a.test.com的含義是管理員的郵箱

/var/name/test.cn 文件下:

$TTL 86400

@ IN SOA b.test.cn. root.a.test.com (

42 ; serial (d. adams)

3H ; refresh

15M ; retry

1W ; expiry

1D ) ; minimum

IN NS b.test.cn.

IN MX 10 mail.test.cn.

b IN A 192.168.1.1

mail IN A 192.168.1.1

/var/name/192.168.1.rev 文件下:

$TTL 86400

@ IN SOA 1.168.192.in-addr.arpa. root.test.com. (

1997022700 ; Serial

28800 ; Refresh

14400 ; Retry

3600000 ; Expire

86400 ) ; Minimum

IN NS a.test.com.

IN NS b.test.cn.

IN MX 10 mail.test.com.

IN MX 10 mail.test.cn.

3 IN PTR a.test.com.

3 IN PTR mail.test.com.

1 IN PTR b.test.cn.

1 IN PTR mail.test.cn.

然後用/etc/init.d/named restart重啟DNS服務,在重啟過程中,我曾經出現過好幾次的錯誤,按照出錯的提示,會提示是named.conf文件第幾行出錯的。或者提示在那些包含文件例如test.cn這些文件裡面的問題,然後一個一個排除。

最後還有一些nslookup的命令比較有用:

set all用於顯示使用nslookup工具這台機器上的DNS伺服器的一些信息

set type=any會顯示完整信息包括域中郵件伺服器和主從DNS伺服器的名字和IP地址

server 192.168.0.1更換查詢的DNS伺服器地址

閱讀全文

與linux系統中配置dns相關的資料

熱點內容
maya粒子表達式教程 瀏覽:84
抖音小視頻如何掛app 瀏覽:283
cad怎麼設置替補文件 瀏覽:790
win10啟動文件是空的 瀏覽:397
jk網站有哪些 瀏覽:134
學編程和3d哪個更好 瀏覽:932
win10移動硬碟文件無法打開 瀏覽:385
文件名是亂碼還刪不掉 瀏覽:643
蘋果鍵盤怎麼打開任務管理器 瀏覽:437
手機桌面文件名字大全 瀏覽:334
tplink默認無線密碼是多少 瀏覽:33
ipaddgm文件 瀏覽:99
lua語言編程用哪個平台 瀏覽:272
政采雲如何導出pdf投標文件 瀏覽:529
php獲取postjson數據 瀏覽:551
javatimetask 瀏覽:16
編程的話要什麼證件 瀏覽:94
錢脈通微信多開 瀏覽:878
中學生學編程哪個培訓機構好 瀏覽:852
榮耀路由TV設置文件共享錯誤 瀏覽:525

友情鏈接