Documentation - Hosts File Importer
The Host File Importer allows the user to import entries already configured in their Windows Hosts file.
The Host File Importer can be accessed from the Control Panel. When the importer screen loads it will automatically read the machines hosts file. The importer will only list entries that are not already configured in Refract DNS.
When the host file is read the tool will identify the following:
- The type of record, either A or AAAA.
- The state of the entry, enabled or disabled
- The domain
- The IP address
The tool will read entries where multiple domains appear on the same line after an IP address. For example the list of entries in the image above were generated from the following hosts file:
# 22.214.171.124 rhino.acme.com # source server # 126.96.36.199 x.acme.com # x client host # localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost 127.0.0.1 www.refractdns.local 2a00:1450:4009:808::200e staging.refractdns.com 188.8.131.52 www.refractdns.com sub.refractdns.com #184.108.40.206 www.refractdns.com #220.127.116.11 www.refractdns.com
After reading the file the the user can choose which entries to import, which entries should be enabled and also add a description for each record.
After importing the hosts file Refract DNS will comment out and mark imported entries. Imported entries will be prefixed with '#RDNS'. In the following example the first entry was imported but the second entry wasn't:
18.104.22.168 sub.refractdns.com 22.214.171.124 www.refractdns.com
#RDNS 126.96.36.199 sub.refractdns.com 188.8.131.52 www.refractdns.com
Where two domains appear on the same line but only one domain was imported Refract DNS will create a new line for the domain that wasn't imported. Refract DNS will also add a comment to indicate that the line was added. In the following example both www.refractdns.com and sub.refractdns.com appeared on the same line but only www.refractdns.com was imported:
184.108.40.206 www.refractdns.com sub.refractdns.com
#RDNS 220.127.116.11 www.refractdns.com sub.refractdns.com 18.104.22.168 sub.refractdns.com #RDNS Added