{"id":62,"date":"2015-11-05T00:46:50","date_gmt":"2015-11-05T00:46:50","guid":{"rendered":"http:\/\/www.morsello.com\/?p=62"},"modified":"2015-11-05T00:50:24","modified_gmt":"2015-11-05T00:50:24","slug":"ignorance-of-ip-name-resolution","status":"publish","type":"post","link":"https:\/\/www.morsello.com\/index.php\/2015\/11\/05\/ignorance-of-ip-name-resolution\/","title":{"rendered":"Ignorance of IP Name Resolution"},"content":{"rendered":"<p>An ideal blog post probably provides answers to others who may be searching. \u00a0This one doesn&#8217;t. \u00a0This is the accounting of the mysteries of &#8220;localhost&#8221; on CentOS linux instances. \u00a0I&#8217;ll post updates as I actually start to understand the answers.<\/p>\n<h3>Fetching a web page from localhost is slower than fetching from 127.0.0.1<\/h3>\n<p>127.0.0.1: average response <span style=\"background-color: #ffff00;\">.015s<\/span><\/p>\n<p>localhost: average response <span style=\"background-color: #ffff00;\">.166s<\/span><\/p>\n<p>So an entire end-to-end fetch is ten times as slow using localhost, and the IP address is apparently not cached, as it doesn&#8217;t get any faster with repeated runs.<\/p>\n<p>Yes, &#8220;localhost&#8221; is an alias to 127.0.0.1 in my hosts file, so I expect that an actual DNS request on the wire should not be necessary.<\/p>\n<h3>WordPress won&#8217;t find my database on host &#8220;localhost&#8221;, but it will find it at 127.0.0.1<\/h3>\n<p>Okay?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An ideal blog post probably provides answers to others who may be searching. \u00a0This one doesn&#8217;t. \u00a0This is the accounting of the mysteries of &#8220;localhost&#8221; on CentOS linux instances. \u00a0I&#8217;ll post updates as I actually start to understand the answers. Fetching a web page from localhost is slower than fetching from 127.0.0.1 127.0.0.1: average response&hellip;<\/p>\n<p><a class=\"more-link\" href=\"https:\/\/www.morsello.com\/index.php\/2015\/11\/05\/ignorance-of-ip-name-resolution\/\" title=\"Continue reading &lsquo;Ignorance of IP Name Resolution&rsquo;\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.morsello.com\/index.php\/wp-json\/wp\/v2\/posts\/62"}],"collection":[{"href":"https:\/\/www.morsello.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.morsello.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.morsello.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.morsello.com\/index.php\/wp-json\/wp\/v2\/comments?post=62"}],"version-history":[{"count":3,"href":"https:\/\/www.morsello.com\/index.php\/wp-json\/wp\/v2\/posts\/62\/revisions"}],"predecessor-version":[{"id":65,"href":"https:\/\/www.morsello.com\/index.php\/wp-json\/wp\/v2\/posts\/62\/revisions\/65"}],"wp:attachment":[{"href":"https:\/\/www.morsello.com\/index.php\/wp-json\/wp\/v2\/media?parent=62"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.morsello.com\/index.php\/wp-json\/wp\/v2\/categories?post=62"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.morsello.com\/index.php\/wp-json\/wp\/v2\/tags?post=62"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}