我们知道,dns用于解析域名后端IP的服务器。
Linux与Windows一样,可自定义DNS地址。
修改DNS的方法如下:
一、修改配置文件
vi /etc/resolv.conf
二、按格式修改
nameserver 8.8.8.8
按以上格式修改为 谷歌(Google)的Domain Name System IP,保存即可生效。
更多有关linux下dns配置的文章,请参考:
FreeBSD下设置IP地址、网关、DNS的方法介绍
centos 5中架设dns+网关的一些问题及解决方法
linux路由配置之修改IP、DNS和路由配置
linux下dns速度慢的解决方法
centos网络配置包括网卡eth0、DNS、Host等
ubuntu网卡地址、DNS、主机名配置
Linux下IP地址、网关、DNS相关命令
Ubuntu设置静态IP与DNS
Ubuntu中配置IP地址与DNS信息
当登录SSH时总是要停顿等待一下才能连接上,此时可以考虑是由于OpenSSH服务器开启了DNS查找选项UseDNS的原因。
UseDNS 选项打开状态下,当客户端试图登录SSH服务器时,服务器端先根据客户端的IP地址进行DNS PTR反向查询出客户端的主机名,然后根据查询出的客户端主机名进行DNS正向A记录查询,验证与其原始IP地址是否一致,这是防止客户端欺骗的一种措施。
一般情况下,动态IP不会有PTR记录,可以考虑关闭掉usedns选项。
关闭usedns选项的具体操作如下。
一、编辑文件
vim /etc/ssh/sshd_config
二、找到以下字符
#UseDNS yes
在其下方新建一行,填入
UseDNS no
三、保存并重启SSH
service sshd restart
附,老外提供的文章。
SSH Reverse DNS Lookup Disable
This isn’t the most interesting of posts, but a good “note to self” for future reference. If not disabled, SSHD will try to do a slow reverse lookup of the IP address of the client causing for an unnecessary delay during authentication. I often run into trouble with this when creating a new install of Linux or FreeBSD.
To disable it, in the file /etc/ssh/sshd_config add the line below:
UseDNS no
您可能感兴趣的文章:
ssh连接缓慢的解决方法
ssh登录很慢但登录成功后速度正常的问题分析
本节分享的内容,用于在linux下查看linux版本、cpu、内存、内核、系统位数等。
1、查看linux版本:
Linux 172-1-1-168.www. 2.6.18-308.16.1.el5 #1 SMP Tue Oct 2 22:01:37 EDT 2012 i686 i686 i386 GNU/Linux
[root@172-1-1-168 ~]# uname -r
2.6.18-308.16.1.el5
2、查看CPU信息:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Pentium(R) Dual-Core CPU E5800 @ 3.20GHz
stepping : 10
cpu MHz : 3192.069
cache size : 2048 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss nx lm constant_tsc up nonstop_tsc pni ssse3 cx16 lahf_lm [8]
bogomips : 6384.13
3、查看CPU位数:
32
4、查看内存:
MemTotal: 1034672 kB
MemFree: 798352 kB
Buffers: 23076 kB
Cached: 88272 kB
SwapCached: 0 kB
Active: 134692 kB
Inactive: 82196 kB
HighTotal: 131008 kB
HighFree: 248 kB
LowTotal: 903664 kB
LowFree: 798104 kB
SwapTotal: 2031608 kB
SwapFree: 2031608 kB
Dirty: 28 kB
Writeback: 0 kB
AnonPages: 105548 kB
Mapped: 19620 kB
Slab: 9652 kB
PageTables: 1556 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 2548944 kB
Committed_AS: 283164 kB
VmallocTotal: 114680 kB
VmallocUsed: 5952 kB
VmallocChunk: 108580 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 4096 kB
5、查看centos版本
CentOS release 5.8 (Final)