{"id":305,"date":"2020-08-18T19:23:47","date_gmt":"2020-08-18T20:23:47","guid":{"rendered":"http:\/\/www.linux-tutorial.info\/?page_id=77"},"modified":"2020-08-22T19:26:39","modified_gmt":"2020-08-22T20:26:39","slug":"this-is-the-page-title-toplevel-140","status":"publish","type":"page","link":"http:\/\/www.linux-tutorial.info\/?page_id=305","title":{"rendered":"The Domain Name System"},"content":{"rendered":"\n<title>DNS &#8211; Finding Other Machines<\/title>\n<question id=\"298\" text=\"The information stored in DNS typically replaces what file?\" \/>\n<p>\nIf you have TCP\/IP installed, by default, your machine is set up to use the \/etc\/hosts file.\nThis is a list of <glossary>IP<\/glossary> addresses and the matching name of the machines.\nWhen you try to connect to another machine, you can do it either with the <glossary>IP<\/glossary>\n<glossary>address<\/glossary>\nor the name. If you use the name, the\nsystem will look in the <file>\/etc\/hosts<\/file> file and make the translation from name to <glossary>IP<\/glossary>\naddress. The only\nreal drawback with this scheme is that every time a machine is added or removed from the <glossary>network<\/glossary>,\nyou have to change the \/etc\/hosts file on all the affected machines.\n<\/p>\n<p>\nThose you of that have had to administer large networks know that updating every <file>\/etc\/hosts<\/file> file like this can be a\nreal pain. There is always at least one that you forget or you mis-type the name or <glossary>address<\/glossary> and\nhave to go back and change it on every machine. Fortunately, there is hope.\n<\/p>\n<p>\nProvided with Linux is a hostname\/IP <glossary>address<\/glossary>\ndatabase called the Berkeley Internet Name Domain (BIND) service. Instead of updated every machine\nin  the <glossary>network<\/glossary>,  there is a <glossary>Domain Name System<\/glossary>\n(DNS) server that maintains the database and provides the <glossary>client<\/glossary>\nmachines with information about both addresses and names. If machines are added or removed, there is\nonly  one  machine that needs to get changed. This is the Name Server. (Note: Some documentation\ntranslates <glossary>DNS<\/glossary> as Domain Name Server. Other references (most importantly the\nRCFs) call it the Domain Name System. I have seen some references call it Domain Name Service. Since\nwe know what it is, I&#8217;ll just call it DNS.)\n<\/p>\n<p>\nSo, when do you use <glossary>DNS<\/glossary>\nover the \/etc\/hosts file? Well, it&#8217;s up to you. The  first question I would ask is &#8220;Are you\nconnecting to  the Internet?&#8221; If the answer is &#8220;yes&#8221;, &#8220;maybe&#8221; or &#8220;someday&#8221; then definitely set up DNS.\n<\/p>\n<p>\nDNS functions somewhat like directory assistance from the phone company. If your local\ndirectory assistance doesn&#8217;t have the number, you can contact one in the area you are looking. If\nyour <glossary>name server<\/glossary> doesn&#8217;t have the answer, it will <em>query<\/em> other name\nservers for that information. (assuming you told it to do so.) Considering how many machine on the Internet,\nit is unrealistic to configure everything in the \/etc\/hosts file.\n<\/p>\n<p>\nIf you are never going to go into the Internet, then the answer is up to you. If you only have\ntwo  machines in your <glossary>network<\/glossary>, the trouble setting up <glossary>DNS<\/glossary>\nis not worth it. On the other hand, if you have a dozen or more machines, then setting it up makes life easier\nin the long run.\n<\/p>\n<p>\nThere are several key concepts that need to be discussed before we dive into <glossary>DNS<\/glossary>.\n The first is DNS, like so many other aspects of TCP\/IP, is client-server oriented. We have the\n<glossary>name server<\/glossary> containing the <glossary>IP<\/glossary>\naddresses and names which serves information to the clients. Next, we need to think about DNS\noperating  in an <glossary>environment<\/glossary> similar to a directory tree. All machines that\nfall under DNS can be thought of as files in this directory tree structure. These machines are often\nreferred to as nodes. Like directories and file names, there is a hierarchy of names with the tree.\nThis  is often referred to as the <glossary>domain<\/glossary> name space.\n<\/p>\n<question id=\"299\" text=\"Which of the following is not one of the original top level internet domains\" \/>\n<question id=\"300\" text=\"The .com domain is limited to commercial organizations within the United States.\" \/>\n<question id=\"\" type=\"mc\" text=\"What where the original top-level domains?\" \/>\n<p>\nA branch of the <glossary>DNS<\/glossary> tree is referred to as a <glossary>domain<\/glossary>. A domain is simply\na collection of computers that are managed by a single organization. This\norganization can be a company, university or even a government agency. The organization has a name\nthat it is know by to the outside world. In conjunction with the domains of the individual\norganizations, there are things called <em>top-level domains<\/em>. These are broken down by the\nfunction of the domains under it. The original top level domains are:\n<\/p>\n<p>\nCOM &#8211; Commercial <br \/>\nEDU &#8211; Educational <br \/>\nGOV &#8211; Government  <br \/>\nNET &#8211; Network  <br \/>\nMIL &#8211; Military <br \/>\nORG &#8211; Non-profit organizations <br \/>\n<p>\nEach <glossary>domain<\/glossary>\nwill fall within one of these top-level domains. For example, there is the domain\n<i>google<\/i>, which falls under the commercial top-level domain. It is thus designated as\n<i>google<\/i>.<i>com<\/i>. The domain assigned to the White House is <i>whitehouse.gov<\/i>. The domain assigned to the\nUniversity of California at Santa Cruz is <i>ucsc.edu<\/i>. (Note that the dot\nis used to separate the individual components in the machine&#8217;s domain and name)\n<\/p>\n<p>\nKeep in mind that these domains are used primarily within the US. While a foreign subsidiary\n<em>might<\/em> belong to one of these top-level domains, for the most part, the top level\n<glossary>domain<\/glossary> within most non-US countries is the country code. For example the\ngeographical domain Germany is indicated by the domain abbreviations de (for Deutschland). These are\nexamples, however. I do know some German companies within the com domain. There are also geographic\ndomains within the US, such as ca.us for California as compared to just .ca for for Canada. This is\noften for very small domains or non-organizations, such as individuals.\n<\/p>\n<p>\nIn many places, they will use a combination of the upper-level domains that are used in the US\nand their own country code. For example, the <glossary>domain<\/glossary> name of an Internet\nprovider in Singapore is <i>singnet.com.sg<\/i>. (Where <i>sg<\/i> is the country code for\nSingapore.)<\/p>\n<p>\n<img decoding=\"async\" src=\"domains.png\" width=604 height=279 border=0  usemap=\"#domains_map\">\n<map name=\"domains_map\">\n<area shape=\"RECT\" coords=\"1,1,602,31\" href=\"popup#Domains#The root domain is a logical entity, similar to the root directory on a filesystem.\">\n<area shape=\"RECT\" coords=\"2,38,603,103\" href=\"popup#Domain#The top level domains serve as the starting point for name to IP-address resolution.\">\n<area shape=\"RECT\" coords=\"2,108,600,162\" href=\"popup#Domains#Organizational or second-level domains must be registered before they are recognized on the Internet.\">\n<area shape=\"RECT\" coords=\"1,166,598,258\" href=\"popup#Domains#Within your organization, you define how machines are named and whether or not there are sub-domains.\">\n<area shape=\"RECT\" coords=\"102,263,603,278\" href=\"popup#Domains#The fully-qualified domain name includes the computer node name and the domain name.\"><\/map>\n<p>\n<icaption>Image &#8211; Internet domains (<b>interactive<\/b>)<\/icaption>\n<\/p>\n<p>\nWithin each <glossary>domain<\/glossary>,\n there <em>may <\/em>be sub-domains. However, there doesn&#8217;t have to be. You usually find sub-domains in\n larger domains in an effort to break down the administration into smaller units. For example, if your company had a sub-domain for sales it might be\nsales.yourdomain.com.\n<\/p>\n<p>\nKeep in mind that these are just the <glossary>domain<\/glossary>\nnames, not the machine, or node name. Within a domain there can be (in principle) any number of\nmachines.  A machine sitting on the desk in the oval office might be called <i>boss1<\/i>. It&#8217;s full\nname, including domain would be <i>boss1.pres.whitehouse.gov<\/i>. A machine in your sales department\ncalled darkstar would then be <i>darkstar.sales.yourdomain.com<\/i>.\n<\/p>\n<p>\nUp to now, I have only seen a machine name with five components: the machine name, two\nsub-domains,  the company <glossary>domain<\/glossary> and then the top-level domain. On the other\nhand, if there was no <i>sales<\/i> sub-domain, and everything was under the<i> yourdomain.com<\/i>\ndomain, the machine&#8217;s name would be: <i>darkstar.yourdomain.com<\/i>.\n<\/p>\n<question id=\"301\" text=\"The fully-qualified domain name (FQDN) of a machine contains both the hostname and the domain name.\" \/>\n<p>\nYou may often see the fully-qualified <glossary>domain<\/glossary>\nname (FQDN) of a machine listed like this:\n<\/p>\n<p>\n<i>darkstar.yourdomain.com.<\/i>\n<\/p>\n<p>\nIncluding the trailing dot(.). That dot indicates the root <glossary>domain<\/glossary>.\n This has no name other that root domain or .(read &#8220;dot&#8221;). Very similar to the way the root\ndirectory  has no name  other than root or \/. In some cases this dot is optional. However, there are\ncases where is it required and we&#8217;ll  get to those in the section on configuring\n<glossary>DNS<\/glossary>.\n<\/p>\n<p>\nLike files, it is possible that two machines have the same name. The only criteria for files is\nthat their <glossary>full path<\/glossary> be unique. The same applies to machines. For example,\nthere might be a machine darkstar at the whitehouse.  (Maybe George is a closet Dead Head) It&#8217;s\n<glossary>FQDN<\/glossary> would be <i>darkstar.whitehouse.gov<\/i>. This is obviously not the same\nmachine as darkstar.yourdomain.com any more than 1033 Main Street in Santa Cruz  is the same as 1033\nMain Street in Annsville. Even something like <i>darkstar.support.yourdomain.com<\/i> is different\nfrom <i>darkstar.sales.yourdomain.com. <\/i>\n<\/p>\n<question id=\"303\" text=\"In addition to domains, what term is used for a collection of machines in DNS?\" \/>\n<p>\nA <glossary>zone<\/glossary> is a grouping of machines that may, or may not, be the same as a <glossary>domain<\/glossary>. This is the set of machines over which a particular <glossary>name server<\/glossary>\nhas authority and maintains the data. In our example above, there might be a zone for support,\n<em>even if<\/em>  there was no sub-domain. On the other hand, there might be a\nteam.support.yourdomain.com domain, but the zone is still yourdomain.com. Therefore, zones can be\nsub-ordinate or superior to domains. Basically, zones are used to make the job of managing the name\nserver easier. Therefore, what constitutes a zone depends on your specific circumstances.\n<\/p>\n<question id=\"304\" text=\"What is the term used for the master server within an DNS domain?\" \/>\n<question id=\"306\" text=\"To which kind of DNS server is information transferred from the primary server?\" \/>\n<question id=\"308\" text=\"What is the process of sending information to other DNS servers?\" \/>\n<p>\nIn <glossary>DNS<\/glossary>,  there are a couple different types of servers. A primary server is the\nmaster server for one or\nmore DNS zones.  Each server maintains the database files, and is considered the authority for this\nzone. It may also periodically transfer data to a secondary server, if one exists for that zone.\n<\/p>\n<question id=\"307\" text=\"What program is the DNS server?\" \/>\n<p>\nDNS functions are carried out by the Internet <glossary>domain<\/glossary>\n<glossary>name server<\/glossary>: <command>named<\/command>. When it starts, named\nreads it&#8217;s configuration file to determine what zones it is responsible for and in which files the\ndata is stored. By default, the configuration file <\/file>\/etc\/named.conf<\/file>. However, named can be started\nwith the -b option to specify an alternate configuration file. Normally, named is started from a\nscript in <directory>\/etc\/rc.d<\/directory>.\n<\/p>\n<p>\nFor example, the primary server for the <i>yourdomain.com<\/i> domain needs to know about the\nmachines within the <i>support.yourdomain.com<\/i> <glossary>domain<\/glossary>.  It could server as\na secondary server to the <i>support.yourdomain.com<\/i> domain, whereby it would maintain all the\nrecords for the machines within that sub-domain. If, on the other hand, it servers as a stub server,\nthe primary for the <i>yourdomain.com<\/i> need only know how to get to the primary for the\n<i>support.yourdomain.com<\/i> sub-domain. Note here, that it <em>is<\/em> possible for a server to be\nprimary in one zone and secondary in another.\n<\/p>\n<p>\nBy moving responsibility to the sub-zone, the <glossary>administrator<\/glossary>\nof the parent zone, does not need to concern him or herself with changing the configurations files\nwhen a machine  is added or removed within the sub-zone. As long as the <glossary>address<\/glossary>\nof sub-zone primary server remains matches the stub server entry all is well.\n<\/p>\n<question id=\"322\" text=\"Which of the following is NOT a type of DNS server?\" \/>\n<p>\nA secondary server takes over for the primary, should the primary go down or be otherwise\ninaccessible. A  secondary server maintains copies of the database files, and &#8220;refreshes&#8221; them at\npredetermined intervals. If it cannot reach the primary to refresh it&#8217;s files, it will keep trying\nat (again) predetermined intervals. If after another predetermined time, the secondary still cannot\nreach the primary, the secondary considers it&#8217;s data invalid and flushes it.\n<\/p>\n<question id=\"309\" text=\"What is the term used to describe how long DNS information is valid?\" \/>\n<question id=\"\" type=\"mc\" text=\"What is a 'caching-only' DNS server?\" \/>\n<question id=\"\" type=\"\" text=\"What is a DNS time-to-live?\" \/>\n<p>\nCaching-only servers saves data in a <glossary>cache<\/glossary>\nfile only until that data expires. The expiration time is based on a field within the data that is\nreceived from another server. This is called the time-to-live. Time-to-live is a regularly occurring\nconcept within <glossary>DNS<\/glossary>.\n<\/p>\n<concept id=\"\" description=\"A DNS slave server can be a primary, secondary, or caching-only server.\" \/>\n<question id=\"\" type=\"TF\" text=\"A DNS slave server can be a primary, secondary, or caching-only server.\" \/>\n<concept id=\"\" description=\"A slave DNS server simply forwards queries recursively to the appropriate DNS server.\" \/>\n<p>\nA slave server can be a primary, secondary, or caching-only server. If it cannot satisfy the\nquery locally, it will pass, or forward, the request to a fixed list of forwarders (forwarding\nserver), rather than interacting directly with the primary name servers of other zones. These\nrequest are recursive, which means that the <glossary>forwarder<\/glossary> must answer either with\nthe requested information or saying it doesn&#8217;t know. The requesting machine then asks the next\nserver, then the next and then the next until it finally runs out of servers to check or gets an\nanswer. Slave servers never attempt to contact servers other than the forwarders.\n<\/p>\n<p>\nThe concept of recursive request is in contrast to iterative requests. Here the queried server\neither gives  an answer or tells the requesting machine where it should look next. For example,\ndarkstar asks, iguana, the primary server for support.yourdomain.com for some information. In a\nrecursive query, iguana asks, boomer, the primary server for yourdomain.com and passes the\ninformation back to darkstar. In a iterative query, iguana tells darkstar about boomer, and darkstar\nthen goes asks boomer. This process of asking name servers for information, whether recursive or\niterative is called <em>resolution<\/em>.\n<\/p>\n<concept id=\"\" description=\"Applications do not access the DNS server directly.\" \/>\n<p>\nKeep in mind that there is <glossary>client<\/glossary>\nsoftware running on the server. When an <glossary>application<\/glossary>\nneeds information, the client <glossary>DNS<\/glossary>\nserver asks the server for the information, despite the fact that the server is running on the same machine.\nApplications don&#8217;t access the DNS server directly.\n<\/p>\n<question id=\"\" type=\"mc\" text=\"What is a root DNS server?\" \/>\n<p>\nThere is also the concept of a root server. These are severs located at the top of  the\n<glossary>domain<\/glossary> tree and maintain information about the top-level zone. Root servers\nare positioned at the top, or root, of the <glossary>DNS<\/glossary> hierarchy, and maintain data\nabout each of the top-level zones.\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DNS &#8211; Finding Other Machines If you have TCP\/IP installed, by default, your machine is set up to use the \/etc\/hosts file. This is a list of IP addresses and the matching name of the machines. When you try to &hellip; <a href=\"http:\/\/www.linux-tutorial.info\/?page_id=305\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-305","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=305"}],"version-history":[{"count":1,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/305\/revisions"}],"predecessor-version":[{"id":740,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/305\/revisions\/740"}],"wp:attachment":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}