{"id":188614,"date":"2020-11-10T14:21:19","date_gmt":"2020-11-10T06:21:19","guid":{"rendered":"http:\/\/4563.org\/?p=188614"},"modified":"2020-11-10T14:21:19","modified_gmt":"2020-11-10T06:21:19","slug":"%e6%b1%82%e8%a7%a3-linux-%e5%af%b9%e6%9c%ac%e5%9c%b0%e4%b8%bb%e6%9c%ba%e5%90%8d%e7%9a%84%e8%a7%a3%e6%9e%90%e6%96%b9%e5%bc%8f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=188614","title":{"rendered":"\u6c42\u89e3 Linux \u5bf9\u672c\u5730\u4e3b\u673a\u540d\u7684\u89e3\u6790\u65b9\u5f0f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6c42\u89e3 Linux \u5bf9\u672c\u5730\u4e3b\u673a\u540d\u7684\u89e3\u6790\u65b9\u5f0f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : enlightment <\/span>  <span><i><\/i> 7<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        centos7 \u672c\u673a\u7684 hostname \u4e3a xxxa<br \/>\u5403\u65f6 ping xxxa \u89e3\u6790\u5230\u4e86 eth1 \u5bf9\u5e94\u7684 ip\uff0c\u8fd9\u4e2a\u89e3\u6790\u8d70\u7684\u662f\u54ea\u91cc\u7684 dns \uff1f\u4e3a\u4ec0\u4e48\u4f1a\u89e3\u6790\u5230 eth1 \u7684 ip \u800c\u4e0d\u662f eth2 eth3 \u7684\uff1f      <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>12<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4019773\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : D0n9 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5148\u8d70 \/etc\/hosts                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4019774\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : enlightment <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \/etc\/hosts \u5e76\u91cc\u6ca1\u6709\u5355\u72ec\u5bf9 xxxa \u505a\u4efb\u4f55\u89e3\u6790                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4019775\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 3dwelcome <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3b\u673a\u540d\u89e3\u6790\u5e95\u5c42\u5c31\u662f\u8c03\u7528 gethostbyname\uff0c\u4f60\u8bf4\u4e3a\u4ec0\u4e48\u4e0d\u5bf9\u5e94\u7b2c\u4e8c\u4e2a ip\uff0c\u7406\u8bba\u4e0a\u5e94\u8be5\u5bf9\u5e94 0.0.0.0\uff0c\u7ed1\u5b9a\u6240\u6709\u7684\u672c\u673a ip\uff0c\u4f46 linux \u7a0b\u5e8f\u5458\u5c31\u662f\u5199\u4e86\u83b7\u53d6\u56de\u6765\u7684\u7b2c\u4e00\u4e2a ip\uff0c\u4f60\u4e5f\u6ca1\u529e\u6cd5\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4019776\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : enlightment <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @3dwelcome \u8fd9\u4e2a\u662f\u5185\u6838\u91cc\u5199\u7684\u903b\u8f91\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4019777\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 3dwelcome <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e25\u683c\u6765\u8bf4\u4e0d\u7b97\u5185\u6838\uff0c\u5c31\u7b97\u662f\u4e2a\u63d0\u4f9b\u7ed9\u7a0b\u5e8f\u7684\u8c03\u7528\u5e93\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4019778\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : julyclyde <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             strace \u4e00\u4e0b ping \u770b\u770b\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4019779\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lenqu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             traceroute \u4e00\u4e0b\uff0c\u770b\u770b\u90a3\u8d70\u7684\u8282\u70b9                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4019780\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : huangmingyou <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             man 5 nsswitch.conf                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4019781\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : huangmingyou <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             # \/etc\/nsswitch.conf<br \/>#<br \/># Example configuration of GNU Name Service Switch functionality.<br \/># If you have the `glibc-doc-reference&#8217; and `info&#8217; packages installed, try:<br \/># `info libc &#8220;Name Service Switch&#8221;&#8216; for information about this file.<\/p>\n<p>passwd: compat<br \/>group: compat<br \/>shadow: compat<br \/>gshadow: files<\/p>\n<p>hosts: files mdns4_minimal [NOTFOUND=return] dns<br \/>networks: files<\/p>\n<p>protocols: db files<br \/>services: db files<br \/>ethers: db files<br \/>rpc: db files<\/p>\n<p>netgroup: nis                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4019782\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : targetFree <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @3dwelcome \u597d\u50cf gethostbyname \u5df2\u88ab getaddrinfo \u66ff\u4ee3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4019783\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : baobao1270 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             systemd resolved?                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4019784\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : enlightment <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @julyclyde <br \/>[[email&#160;protected] ~]# strace -f -e open ping cent7.550gtmp<br \/>open(&#8220;\/etc\/ld.so.cache&#8221;, O_RDONLY|O_CLOEXEC) = 3<br \/>open(&#8220;\/lib64\/libcap.so.2&#8221;, O_RDONLY|O_CLOEXEC) = 3<br \/>open(&#8220;\/lib64\/libidn.so.11&#8221;, O_RDONLY|O_CLOEXEC) = 3<br \/>open(&#8220;\/lib64\/libcrypto.so.10&#8221;, O_RDONLY|O_CLOEXEC) = 3<br \/>open(&#8220;\/lib64\/libresolv.so.2&#8221;, O_RDONLY|O_CLOEXEC) = 3<br \/>open(&#8220;\/lib64\/libm.so.6&#8221;, O_RDONLY|O_CLOEXEC) = 3<br \/>open(&#8220;\/lib64\/libc.so.6&#8221;, O_RDONLY|O_CLOEXEC) = 3<br \/>open(&#8220;\/lib64\/libattr.so.1&#8221;, O_RDONLY|O_CLOEXEC) = 3<br \/>open(&#8220;\/lib64\/libdl.so.2&#8221;, O_RDONLY|O_CLOEXEC) = 3<br \/>open(&#8220;\/lib64\/libz.so.1&#8221;, O_RDONLY|O_CLOEXEC) = 3<br \/>open(&#8220;\/etc\/pki\/tls\/legacy-settings&#8221;, O_RDONLY) = -1 ENOENT (No such file or directory)<br \/>open(&#8220;\/usr\/lib\/locale\/locale-archive&#8221;, O_RDONLY|O_CLOEXEC) = 3<br \/>open(&#8220;\/etc\/resolv.conf&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/etc\/nsswitch.conf&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/etc\/ld.so.cache&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/lib64\/libnss_files.so.2&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/etc\/host.conf&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/etc\/hosts&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/etc\/ld.so.cache&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/lib64\/libnss_dns.so.2&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/etc\/ld.so.cache&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/lib64\/libnss_myhostname.so.2&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/lib64\/librt.so.1&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/lib64\/libdw.so.1&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/lib64\/libgcc_s.so.1&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/lib64\/libpthread.so.0&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/usr\/lib64\/elfutils\/tls\/x86_64\/libelf.so.1&#8221;, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)<br \/>open(&#8220;\/usr\/lib64\/elfutils\/tls\/libelf.so.1&#8221;, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)<br \/>open(&#8220;\/usr\/lib64\/elfutils\/x86_64\/libelf.so.1&#8221;, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)<br \/>open(&#8220;\/usr\/lib64\/elfutils\/libelf.so.1&#8221;, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)<br \/>open(&#8220;\/lib64\/libelf.so.1&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/usr\/lib64\/elfutils\/liblzma.so.5&#8221;, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)<br \/>open(&#8220;\/lib64\/liblzma.so.5&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/usr\/lib64\/elfutils\/libbz2.so.1&#8221;, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)<br \/>open(&#8220;\/lib64\/libbz2.so.1&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/etc\/hosts&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>open(&#8220;\/etc\/gai.conf&#8221;, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)<br \/>PING cent7.550gtmp (10.0.182.120) 56(84) bytes of data.<br \/>open(&#8220;\/etc\/hosts&#8221;, O_RDONLY|O_CLOEXEC) = 4<br \/>64 bytes from cent7.550gtmp (10.0.112.1): icmp_seq=1 ttl=64 time=0.050 ms<br \/>64 bytes from cent7.550gtmp (10.0.112.1): icmp_seq=2 ttl=64 time=0.104 ms<br \/>64 bytes from cent7.550gtmp (10.0.112.1): icmp_seq=3 ttl=64 time=0.049 ms<br \/>64 bytes from cent7.550gtmp (10.0.112.1): icmp_seq=4 ttl=64 time=0.047 ms<br \/>^C<br \/>strace: Process 56574 detached                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6c42\u89e3 Linux \u5bf9\u672c\u5730\u4e3b\u673a\u540d\u7684\u89e3&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/188614"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=188614"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/188614\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=188614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=188614"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=188614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}