Skynet: DNS                                       
                                                                                                    
                                           Its always DNS                                           
                                                                                                    
                                                                                                    
                                             2023-10-14                                             
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                              Brendan                                               
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                    DNS - Overview                                    
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is both simple and complex.                                                             
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                             2 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                    DNS - Overview                                    
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is both simple and complex.                                                             
                                                                                                    
        Computers are good with numbers and like everything labeled as such.                        
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                             3 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                    DNS - Overview                                    
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is both simple and complex.                                                             
                                                                                                    
        Computers are good with numbers and like everything labeled as such.                        
                                                                                                    
        Humans not so much.                                                                         
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                             4 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                    DNS - Overview                                    
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is both simple and complex.                                                             
                                                                                                    
        Computers are good with numbers and like everything labeled as such.                        
                                                                                                    
        Humans not so much.                                                                         
                                                                                                    
        So we need a translation layer between humans and computers.                                
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                             5 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                    DNS - Overview                                    
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is both simple and complex.                                                             
                                                                                                    
        Computers are good with numbers and like everything labeled as such.                        
                                                                                                    
        Humans not so much.                                                                         
                                                                                                    
        So we need a translation layer between humans and computers.                                
                                                                                                    
        Domain Name System (DNS)                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                             6 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is a pretty good example of a system which haas gone though many iterations.            
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                             7 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is a pretty good example of a system which haas gone though many iterations.            
                                                                                                    
        Long ago the "internet" was small enough ye could draw a map of all computers on a          
        single sheet of paper.                                                                      
        "Internet" because it was the pre-internet, ARPANET.                                        
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                             8 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is a pretty good example of a system which haas gone though many iterations.            
                                                                                                    
        Long ago the "internet" was small enough ye could draw a map of all computers on a          
        single sheet of paper.                                                                      
        "Internet" because it was the pre-internet, ARPANET.                                        
                                                                                                    
        It started with a single text file, now known as a hostfile (                               
        https://www.rfc-editor.org/rfc/rfc608)                                                      
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                             9 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is a pretty good example of a system which haas gone though many iterations.            
                                                                                                    
        Long ago the "internet" was small enough ye could draw a map of all computers on a          
        single sheet of paper.                                                                      
        "Internet" because it was the pre-internet, ARPANET.                                        
                                                                                                    
        It started with a single text file, now known as a hostfile (                               
        https://www.rfc-editor.org/rfc/rfc608)                                                      
                                                                                                    
        To get added to this file you would have to ask Elizabeth "Jake" Feinler (                  
        https://en.wikipedia.org/wiki/Elizabeth_J._Feinler) to be added.                            
        (Her life is really interesting and apparently she is still alive)                          
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                            10 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is a pretty good example of a system which haas gone though many iterations.            
                                                                                                    
        Long ago the "internet" was small enough ye could draw a map of all computers on a          
        single sheet of paper.                                                                      
        "Internet" because it was the pre-internet, ARPANET.                                        
                                                                                                    
        It started with a single text file, now known as a hostfile (                               
        https://www.rfc-editor.org/rfc/rfc608)                                                      
                                                                                                    
        To get added to this file you would have to ask Elizabeth "Jake" Feinler (                  
        https://en.wikipedia.org/wiki/Elizabeth_J._Feinler) to be added.                            
        (Her life is really interesting and apparently she is still alive)                          
                                                                                                    
        Having a single file like this dosent scale well, so over time the ability to               
        delegate responsibility was implemented.                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                            11 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is a pretty good example of a system which haas gone though many iterations.            
                                                                                                    
        Long ago the "internet" was small enough ye could draw a map of all computers on a          
        single sheet of paper.                                                                      
        "Internet" because it was the pre-internet, ARPANET.                                        
                                                                                                    
        It started with a single text file, now known as a hostfile (                               
        https://www.rfc-editor.org/rfc/rfc608)                                                      
                                                                                                    
        To get added to this file you would have to ask Elizabeth "Jake" Feinler (                  
        https://en.wikipedia.org/wiki/Elizabeth_J._Feinler) to be added.                            
        (Her life is really interesting and apparently she is still alive)                          
                                                                                                    
        Having a single file like this dosent scale well, so over time the ability to               
        delegate responsibility was implemented.                                                    
                                                                                                    
        For Skynet.ie the process goes as follows:                                                  
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                            12 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is a pretty good example of a system which haas gone though many iterations.            
                                                                                                    
        Long ago the "internet" was small enough ye could draw a map of all computers on a          
        single sheet of paper.                                                                      
        "Internet" because it was the pre-internet, ARPANET.                                        
                                                                                                    
        It started with a single text file, now known as a hostfile (                               
        https://www.rfc-editor.org/rfc/rfc608)                                                      
                                                                                                    
        To get added to this file you would have to ask Elizabeth "Jake" Feinler (                  
        https://en.wikipedia.org/wiki/Elizabeth_J._Feinler) to be added.                            
        (Her life is really interesting and apparently she is still alive)                          
                                                                                                    
        Having a single file like this dosent scale well, so over time the ability to               
        delegate responsibility was implemented.                                                    
                                                                                                    
        For Skynet.ie the process goes as follows:                                                  
                                                                                                    
           •  ICANN are the top level controllers but they delegate to:                             
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                            13 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is a pretty good example of a system which haas gone though many iterations.            
                                                                                                    
        Long ago the "internet" was small enough ye could draw a map of all computers on a          
        single sheet of paper.                                                                      
        "Internet" because it was the pre-internet, ARPANET.                                        
                                                                                                    
        It started with a single text file, now known as a hostfile (                               
        https://www.rfc-editor.org/rfc/rfc608)                                                      
                                                                                                    
        To get added to this file you would have to ask Elizabeth "Jake" Feinler (                  
        https://en.wikipedia.org/wiki/Elizabeth_J._Feinler) to be added.                            
        (Her life is really interesting and apparently she is still alive)                          
                                                                                                    
        Having a single file like this dosent scale well, so over time the ability to               
        delegate responsibility was implemented.                                                    
                                                                                                    
        For Skynet.ie the process goes as follows:                                                  
                                                                                                    
           •  ICANN are the top level controllers but they delegate to:                             
              ◦  https://en.wikipedia.org/wiki/ICANN                                                
                                                                                                    
                                                                                                    
                                                                                            14 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is a pretty good example of a system which haas gone though many iterations.            
                                                                                                    
        Long ago the "internet" was small enough ye could draw a map of all computers on a          
        single sheet of paper.                                                                      
        "Internet" because it was the pre-internet, ARPANET.                                        
                                                                                                    
        It started with a single text file, now known as a hostfile (                               
        https://www.rfc-editor.org/rfc/rfc608)                                                      
                                                                                                    
        To get added to this file you would have to ask Elizabeth "Jake" Feinler (                  
        https://en.wikipedia.org/wiki/Elizabeth_J._Feinler) to be added.                            
        (Her life is really interesting and apparently she is still alive)                          
                                                                                                    
        Having a single file like this dosent scale well, so over time the ability to               
        delegate responsibility was implemented.                                                    
                                                                                                    
        For Skynet.ie the process goes as follows:                                                  
                                                                                                    
           •  ICANN are the top level controllers but they delegate to:                             
              ◦  https://en.wikipedia.org/wiki/ICANN                                                
           •  IEDR, These folks are in charge of all .ie domains                                    
                                                                                                    
                                                                                            15 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is a pretty good example of a system which haas gone though many iterations.            
                                                                                                    
        Long ago the "internet" was small enough ye could draw a map of all computers on a          
        single sheet of paper.                                                                      
        "Internet" because it was the pre-internet, ARPANET.                                        
                                                                                                    
        It started with a single text file, now known as a hostfile (                               
        https://www.rfc-editor.org/rfc/rfc608)                                                      
                                                                                                    
        To get added to this file you would have to ask Elizabeth "Jake" Feinler (                  
        https://en.wikipedia.org/wiki/Elizabeth_J._Feinler) to be added.                            
        (Her life is really interesting and apparently she is still alive)                          
                                                                                                    
        Having a single file like this dosent scale well, so over time the ability to               
        delegate responsibility was implemented.                                                    
                                                                                                    
        For Skynet.ie the process goes as follows:                                                  
                                                                                                    
           •  ICANN are the top level controllers but they delegate to:                             
              ◦  https://en.wikipedia.org/wiki/ICANN                                                
           •  IEDR, These folks are in charge of all .ie domains                                    
              ◦  https://en.wikipedia.org/wiki/IE_Domain_Registry                                   
                                                                                            16 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is a pretty good example of a system which haas gone though many iterations.            
                                                                                                    
        Long ago the "internet" was small enough ye could draw a map of all computers on a          
        single sheet of paper.                                                                      
        "Internet" because it was the pre-internet, ARPANET.                                        
                                                                                                    
        It started with a single text file, now known as a hostfile (                               
        https://www.rfc-editor.org/rfc/rfc608)                                                      
                                                                                                    
        To get added to this file you would have to ask Elizabeth "Jake" Feinler (                  
        https://en.wikipedia.org/wiki/Elizabeth_J._Feinler) to be added.                            
        (Her life is really interesting and apparently she is still alive)                          
                                                                                                    
        Having a single file like this dosent scale well, so over time the ability to               
        delegate responsibility was implemented.                                                    
                                                                                                    
        For Skynet.ie the process goes as follows:                                                  
                                                                                                    
           •  ICANN are the top level controllers but they delegate to:                             
              ◦  https://en.wikipedia.org/wiki/ICANN                                                
           •  IEDR, These folks are in charge of all .ie domains                                    
              ◦  https://en.wikipedia.org/wiki/IE_Domain_Registry                                   
           •  Skynet, we host our own DNS server                                            17 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS is a pretty good example of a system which haas gone though many iterations.            
                                                                                                    
        Long ago the "internet" was small enough ye could draw a map of all computers on a          
        single sheet of paper.                                                                      
        "Internet" because it was the pre-internet, ARPANET.                                        
                                                                                                    
        It started with a single text file, now known as a hostfile (                               
        https://www.rfc-editor.org/rfc/rfc608)                                                      
                                                                                                    
        To get added to this file you would have to ask Elizabeth "Jake" Feinler (                  
        https://en.wikipedia.org/wiki/Elizabeth_J._Feinler) to be added.                            
        (Her life is really interesting and apparently she is still alive)                          
                                                                                                    
        Having a single file like this dosent scale well, so over time the ability to               
        delegate responsibility was implemented.                                                    
                                                                                                    
        For Skynet.ie the process goes as follows:                                                  
                                                                                                    
           •  ICANN are the top level controllers but they delegate to:                             
              ◦  https://en.wikipedia.org/wiki/ICANN                                                
           •  IEDR, These folks are in charge of all .ie domains                                    
              ◦  https://en.wikipedia.org/wiki/IE_Domain_Registry                                   
           •  Skynet, we host our own DNS server                                            18 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS records are pretty simple.                                                              
        A single record per line in a consistent format                                             
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                            19 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS records are pretty simple.                                                              
        A single record per line in a consistent format                                             
                                                                                                    
        This defines where to find the skynet.skynet.ie server.                                     
        Then it creates a subdomain *.users.skynet.skynet.ie which is a wildcard.                   
        So silver.users.skynet.skynet.ie matches.                                                   
                                                                                                    
                                                                                                    
                           # {NAME}  {TYPE}   {WHERE IT POINTS TO}                                  
                           skynet  IN A     193.1.96.165                                            
                           *.users IN CNAME skynet                                                  
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                            20 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                                   DNS - Structure                                   
                                                                                                    
                                                                                                    
                                                                                                    
        DNS records are pretty simple.                                                              
        A single record per line in a consistent format                                             
                                                                                                    
        This defines where to find the skynet.skynet.ie server.                                     
        Then it creates a subdomain *.users.skynet.skynet.ie which is a wildcard.                   
        So silver.users.skynet.skynet.ie matches.                                                   
                                                                                                    
                                                                                                    
                           # {NAME}  {TYPE}   {WHERE IT POINTS TO}                                  
                           skynet  IN A     193.1.96.165                                            
                           *.users IN CNAME skynet                                                  
                                                                                                    
                                                                                                    
        You can use DNS to distribute other useful information, such as email config:               
                                                                                                    
                                                                                                    
                        skynet.ie. IN TXT   "v=spf1 a:mail.skynet.ie -all"                          
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                            21 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                             DNS - Viewing records                             
                                                                                                    
                                                                                                    
                                                                                                    
        ▓▓▓ Live DNS                                                                                
                                                                                                    
        We can use a command to get records for anything.                                           
        Ye can also specify what server to get the request from.                                    
                                                                                                    
                                                                                                    
                           dig skynet.ie                                                            
                           dig skynet.ie @1.1.1.1                                                   
                           dig skynet.ie @ns1.skynet.ie                                             
                           host 193.1.99.75                                                         
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                            22 / 23 
                                                                                                    
                                                                                                    
                                                                                                    
                             DNS - Viewing records                             
                                                                                                    
                                                                                                    
                                                                                                    
        ▓▓▓ Live DNS                                                                                
                                                                                                    
        We can use a command to get records for anything.                                           
        Ye can also specify what server to get the request from.                                    
                                                                                                    
                                                                                                    
                           dig skynet.ie                                                            
                           dig skynet.ie @1.1.1.1                                                   
                           dig skynet.ie @ns1.skynet.ie                                             
                           host 193.1.99.75                                                         
                                                                                                    
                                                                                                    
        ▓▓▓ Nixos DNS                                                                               
                                                                                                    
        Since we run our own dns server we can pull the actual file directly from nixos (           
        https://forgejo.skynet.ie/Skynet/nixos):                                                    
                                                                                                    
                                                                                                    
                 colmena build --keep-result --on vendetta                                          
                 cat .gcroots/node-vendetta/etc/skynet/dns/skynet.ie                                
                 cat                                                                                
                 .gcroots/node-vendetta/etc/skynet/dns/64-64.99.1.193.in-addr.arpa                  
                                                                                            23 / 23