Linux中如何设置域名服务器

Linux中如何设置域名服务器,第1张

etc/hosts 文件的具体内容如下: # Do not remove the following line, or various programs # that require network functionality will fail 127001 localhostlocaldomain localhost fc4 19216813 atestcom a 19216811 btestcn b /etc/hostconf 文件: order hosts,bind 表示先用hosts文件做解析,在用DNS解析 /etc/resolvconf 文件: ; generated by NetworkManager, do not edit! search testcom nameserver 127001 search testcn nameserver 19216811 nameserver 6114456100 /etc/namedconf 文件: // // namedconf for Red Hat caching-nameserver // options { directory "/var/named"; dump-file "/var/named/data/cache_dumpdb"; statistics-file "/var/named/data/named_statstxt"; / 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 81 uses an unprivileged port by default / // query-source address port 53; }; // // a caching only nameserver config // controls { inet 127001 allow { localhost; } keys { rndckey; }; }; zone "" IN { type hint; file "namedca"; }; zone "testcom"IN { type master; file "testcom"; allow-update { none; }; }; zone "1168192in-addrarpa"IN { type master; file "1921681rev"; allow-update { none; }; }; zone "testcn"IN { type master; file "testcn"; allow-update { none; }; }; zone "0000000000000000000000000000000ip6arpa" IN { type master; file "namedip6local"; allow-update { none; }; }; zone "255in-addrarpa" IN { type master; file "namedbroadcast"; allow-update { none; }; }; zone "0in-addrarpa" IN { type master; file "namedzero"; allow-update { none; }; }; include "/etc/rndckey"; 在/var/name/testcom 文件下: $TTL 86400 @ IN SOA atestcom rootatestcom ( 42 ; serial (d adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum IN NS atestcom IN MX 10 mailtestcom a IN A 19216813 mail IN A 19216813 //其中rootatestcom的含义是管理员的邮箱 /var/name/testcn 文件下: $TTL 86400 @ IN SOA btestcn rootatestcom ( 42 ; serial (d adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum IN NS btestcn IN MX 10 mailtestcn b IN A 19216811 mail IN A 19216811 /var/name/1921681rev 文件下: $TTL 86400 @ IN SOA 1168192in-addrarpa roottestcom ( 1997022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS atestcom IN NS btestcn IN MX 10 mailtestcom IN MX 10 mailtestcn 3 IN PTR atestcom 3 IN PTR mailtestcom 1 IN PTR btestcn 1 IN PTR mailtestcn 然后用/etc/initd/named restart重启DNS服务,在重启过程中,我曾经出现过好几次的错误,按照出错的提示,会提示是namedconf文件第几行出错的。或者提示在那些包含文件例如testcn这些文件里面的问题,然后一个一个排除。 最后还有一些nslookup的命令比较有用: set all用于显示使用nslookup工具这台机器上的DNS服务器的一些信息 set type=any会显示完整信息包括域中邮件服务器和主从DNS服务器的名字和IP地址 server 19216801更换查询的DNS服务器地址。

1、首先,连接相应linux主机,进入到linux命令行状态下,等待输入shell指令

2、在linux命令行下输入shell指令:cat /proc/cpuinfo,按回车,会看到cpu的信息。

3、输入shell指令:fdisk -l,按回车,会看到硬盘的信息。

Usage: host [-aCdlriTwv] [-c class] [-N ndots] [-t type] [-W time] [-R number] hostname [server] -a is equivalent to -v -t -c specifies query class for non-IN data -C compares SOA records on authoritative nameservers -d is equivalent to -v -l lists all hosts in a domain, using AXFR -i IP6INT reverse lookups -N changes the number of dots allowed before root lookup is done -r disables recursive processing -R specifies number of retries for UDP packets -t specifies the query type -T enables TCP/IP mode -v enables verbose output -w specifies to wait forever for a reply -W specifies how long to wait for a reply -4 use IPv4 query transport only -6 use IPv6 query transport only -s a SERVFAIL response should stop query

登陆SSH,通常需要root登陆,我们可以选择putty来连接服务器,有以下几行命令:
wget -c >

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/13457293.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-08-10
下一篇 2023-08-10

发表评论

登录后才能评论

评论列表(0条)

保存