{"id":157,"date":"2024-01-24T14:20:36","date_gmt":"2024-01-24T21:20:36","guid":{"rendered":"https:\/\/dnstrouble.crider.dev\/?docs=common-problems-ssh-login-hangs-delays\/outgoing-flow"},"modified":"2024-01-24T14:27:03","modified_gmt":"2024-01-24T21:27:03","slug":"outgoing-flow","status":"publish","type":"docs","link":"https:\/\/dnstrouble.crider.dev\/?docs=common-problems-ssh-login-hangs-delays\/outgoing-flow","title":{"rendered":"The first step: glibc"},"content":{"rendered":"\n<p>Outgoing DNS queries are when a system attempts to look up DNS entries for domain name.<\/p>\n\n\n\n<p>For example if I type www.redhat.com in my browser, it creates an &#8216;outgoing&#8217; query &#8212; we are sending an outgoing request to find out what the DNS entries are for www.redhat.com.<\/p>\n\n\n\n<p>As mentioned there is a &#8216;flow&#8217; to this as to how to gets processed through several components.<\/p>\n\n\n\n<p>The typical outgoing flow starts like so:<\/p>\n\n\n\n<p>command\/application sends query for www.redhat.com -> glibc -> nsswitch<\/p>\n\n\n\n<p>glibc has two main functions &#8212; the older legacy <a href=\"https:\/\/man7.org\/linux\/man-pages\/man3\/gethostbyname.3.html\"><code>gethostbyname()<\/code><\/a>\u00a0and\/or the more modern\u00a0<a href=\"https:\/\/linux.die.net\/man\/3\/getaddrinfo\"><code>getaddrinfo()<\/code><\/a>\u00a0to translate the hostname or fully qualified domain name (FQDN) to an IPv4\/IPv6 address.<\/p>\n\n\n\n<p>When it does this, the first step it takes is to pass the request to The Name Service Switch (nsswitch). The Name Service Switch (NSS) configuration file,\u00a0<a href=\"https:\/\/linux.die.net\/man\/5\/nsswitch.conf\"><code>\/etc\/nsswitch.conf<\/code><\/a>, is used to configure the sources from which to obtain name-service information and in what order.<\/p>\n\n\n\n<p><strong>It&#8217;s important to note that DNS specific tools such as &#8216;nslookup&#8217; and &#8216;dig&#8217; do -NOT- go through glibc, and therefore do not go through nsswitch. They use \/etc\/resolv.conf directly (more on that later).<\/strong><\/p>\n","protected":false},"featured_media":0,"parent":37,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"_links":{"self":[{"href":"https:\/\/dnstrouble.crider.dev\/index.php?rest_route=\/wp\/v2\/docs\/157"}],"collection":[{"href":"https:\/\/dnstrouble.crider.dev\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/dnstrouble.crider.dev\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/dnstrouble.crider.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=157"}],"version-history":[{"count":3,"href":"https:\/\/dnstrouble.crider.dev\/index.php?rest_route=\/wp\/v2\/docs\/157\/revisions"}],"predecessor-version":[{"id":162,"href":"https:\/\/dnstrouble.crider.dev\/index.php?rest_route=\/wp\/v2\/docs\/157\/revisions\/162"}],"up":[{"embeddable":true,"href":"https:\/\/dnstrouble.crider.dev\/index.php?rest_route=\/wp\/v2\/docs\/37"}],"next":[{"title":"The Name Service Switch (nsswitch)","link":"https:\/\/dnstrouble.crider.dev\/?docs=common-problems-ssh-login-hangs-delays\/the-name-service-switch-nsswitch","href":"https:\/\/dnstrouble.crider.dev\/index.php?rest_route=\/wp\/v2\/docs\/163"}],"wp:attachment":[{"href":"https:\/\/dnstrouble.crider.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=157"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/dnstrouble.crider.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}