Skip to main content

DNS and Hosts Resolution

====================================================================================

DNS and Hosts Testing

------------------------------------------------------------------------------------------------------------------------------------------  

dig domainname

dig from a specific DNS server

dig domainname @DNS_ServerIP

====================================================================================

DNS and Hosts Configuration

------------------------------------------------------------------------------------------------------------------------------------------  

/etc/resolv.conf

DNS servers can be configured for linux systems within /etc/resolv.conf.

------------------------------------------------------------------------------------------------------------------------------------------  

/etc/hosts

The /etc/hosts file can be thought of as essentially a local DNS configuration. This means that DNS entries can be mapped here, overwriting any DNS entries provided by an external service.

Entries into the /etc/hosts file can be formatted as follows:

IPaddress domainname

------------------------------------------------------------------------------------------------------------------------------------------