CentOS和Debian之间的名称解析差异
我有一个小的Java程序,它每秒循环调用InetAddress.getByName(“ example.com”)。当我使用'strace -f'在CentOS 6.4盒子上运行它时,我看到/etc/resolv.conf已打开并读取一次: $ grep /etc/resolv.conf strace.out [pid 24810] open("/etc/resolv.conf", O_RDONLY) = 6 当我在Debian 7上运行它时,我看到/etc/resolv.conf被重复打开或stat()': $ grep /etc/resolv.conf strace.out [pid 41821] open("/etc/resolv.conf", O_RDONLY) = 10 [pid 41821] stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=92, ...}) = 0 [pid 41821] open("/etc/resolv.conf", O_RDONLY) = 10 [pid 41821] stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=92, ...}) = 0 [pid 41821] …