LOCAL DNS RESOLUTION

browsers initially looks at dns records in the locally stored hosts file. if the requested domain does not exist within it, then the system contacts other DNS servers.

root@sa:~$ nano /etc/hosts
 {ip address} {domain}
 * ALT: sudo sh -c 'echo "{ipAddress} {fqdn.tld}" >> /etc/hosts'
        echo "{ipAddress fqdn.tld" | sudo tee -a /etc/hosts
root@sa:~$ BROWSER > {domain.com}
 * the domain can now be used in the URL
 * Location
    - Windows
       - C:\Windows\System32\drivers\etc\hosts
    - Linux
       - /etc/hosts

NAME-BASED VIRTUAL HOSTING

this is a method for hosting multiple domain names (with separate handling of each name) on a single server. This allows one server to share its resources, such as memory and processor cycles, w/o requiring all the services to be used by the same hostname. The web server checks the domain name provided in the Host header field of the HTTP request and sends a response according to that.

root@oco:~$ echo "{ipAddress fqdn.tld" | sudo tee -a /etc/hosts


 * input the target ipAddress entry and FQDN to access a target that may be using
   name-based virtual hosting
    - this will make the browser include the HTTP header Host: "fqdn.tld" in every
      HTTP request that the browser sends to the specified IP address, which will 
      make the server respond with the webpage

Last updated