/etc/hosts file hard limits
There are hard limits for the line size and number of aliases in the /etc/hosts
file.
The following are hard limits for the
/etc/hosts
file:
- Maximum line size is 256.
- Maximum number of name servers is 3.
- Maximum domain name length is 256.
- Maximum search domains limit is 6. The total number of
characters for all search domains cannot exceed 256.
- No file size limit.
Note: The line size limit includes the end of line character. You can add up to 255 characters per line.