hosts/CONTEXT.md
phg 7872991e0b Refactor test cases for improved readability and consistency
- Updated test_dns.py to enhance mock function definitions and improve spacing for better readability.
- Modified test_filters.py to streamline assertions and ensure consistent formatting across test cases.
- Cleaned up test_import_export.py by organizing imports and ensuring consistent formatting in CSV and JSON tests.
- Improved test_main.py by refining mock setups and ensuring consistent error handling in assertions.
2026-09-03 12:47:11 +02:00

2 KiB

Hosts Management

This context describes the language used by the terminal application that manages the system hosts file. These terms distinguish operating-system host mappings from application modes and DNS-derived mappings.

Language

Hosts File: The system file containing local mappings from IP addresses to hostnames. Avoid: Host database, configuration file

Host Entry: One IP-address mapping with one or more hostnames and an optional comment. Avoid: Record, row

Canonical Hostname: The first hostname in a Host Entry and the primary name displayed for it. Avoid: Primary domain, main host

Alias: Any hostname after the Canonical Hostname in the same Host Entry. Avoid: Secondary domain, alternate entry

Active Entry: A Host Entry whose mapping participates in host resolution because its line is not commented out. Avoid: Enabled host

Inactive Entry: A Host Entry retained in the Hosts File as a commented-out mapping. Avoid: Disabled host, deleted entry

Default Entry: A protected Host Entry representing a baseline localhost or broadcasthost mapping expected by the operating system. Avoid: Built-in row, standard record

DNS Entry: A Host Entry whose IP address is derived from a configured DNS name and then stored as a normal hosts mapping. Avoid: CNAME, dynamic host

Resolved IP: The IP address most recently obtained for a DNS Entry's configured DNS name. Avoid: Lookup result, dynamic IP

Read-only Mode: The normal application state in which the Hosts File can be inspected but not changed. Avoid: View mode, safe mode

Privileged Mode: The application state in which system authorization has been validated and Host Entries may be changed. Avoid: Edit mode, sudo mode

Pre-edit Backup: A timestamped copy of the Hosts File created before Privileged Mode begins. Avoid: Session backup, safety snapshot

Entry Editor: The form for changing one Host Entry while the application is in Privileged Mode. Avoid: Edit mode, detail mode