- 论坛徽章:
- 1
|
RHEL linux 域名解析规则如下:
先根据/etc/hosts解析,若解析不了,根据/etc/resolv.conf中配置的域名解析地址解析
这种问题有个解决方法,就是查看他的系统调用,看慢在了什么地方:
执行:strace -eopen,read route
如下:可查看其系统调用
open("/etc/nsswitch.conf", O_RDONLY) = 4
read(4, "#\n# /etc/nsswitch.conf\n#\n# An ex"..., 4096) = 1688
read(4, "", 4096) = 0
open("/etc/ld.so.cache", O_RDONLY) = 4
open("/lib64/libnss_files.so.2", O_RDONLY) = 4
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360!\0\0\0\0\0\0"..., 832) = 832
open("/etc/resolv.conf", O_RDONLY) = 4
read(4, "; generated by /sbin/dhclient-sc"..., 4096) = 80
read(4, "", 4096) = 0
open("/etc/networks", O_RDONLY|O_CLOEXEC) = 4
read(4, "default 0.0.0.0\nloopback 127.0.0"..., 4096) = 58
read(4, "", 4096) = 0
192.168.52.0 * 255.255.255.0 U 0 0 0 eth0
open("/etc/networks", O_RDONLY|O_CLOEXEC) = 4
read(4, "default 0.0.0.0\nloopback 127.0.0"..., 4096) = 58
read(4, "", 4096) = 0
192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0
open("/etc/host.conf", O_RDONLY) = 4
read(4, "multi on\n", 4096) = 9
read(4, "", 4096) = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 4
read(4, "192.168.52.150 erpeng\n127.0.0.1"..., 4096) = 189
read(4, "", 4096) = 0
open("/etc/ld.so.cache", O_RDONLY) = 4
open("/lib64/libnss_dns.so.2", O_RDONLY) = 4
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\20\0\0\0\0\0\0"..., 832) = 832
open("/lib64/libresolv.so.2", O_RDONLY) = 4
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\00009\340\327>\0\0\0"..., 832) = 832
default localhost 0.0.0.0 UG 0 0 0 eth0
read(3, "", 1024)
|
|