hosts(5) support.
Function | searchFileForAll | Search the given file, which is in hosts(5) standard format, for addresses associated with a given name. |
Function | searchFileFor | Grep given file, which is in hosts(5) standard format, for an address entry with a given name. |
Class | Resolver | A resolver that services hosts(5) format files. |
Search the given file, which is in hosts(5) standard format, for addresses associated with a given name.
Parameters | hostsFile | The name of the hosts(5)-format file to search. (type: FilePath ) |
name | The name to search for. (type: bytes ) | |
Returns | None if the name is not found in the file, otherwise a str giving the address in the file associated with the name. |
Grep given file, which is in hosts(5) standard format, for an address entry with a given name.
Parameters | file | The name of the hosts(5)-format file to search. (type: str or bytes ) |
name | The name to search for. (type: bytes ) | |
Returns | None if the name is not found in the file, otherwise a str giving the first address in the file associated with the name. |