Determine the Maximum Host Name Length in Linux with HOST_NAME_MAX
smehta26
6:44 am on February 3, 2010
“If anyone wondered what is the max length of hostname you can use (solutions and guess over the internet already), but just itching to write down how to find out. Here’s how..
krish@lin-hyd-dsk-07:~> getconf HOST_NAME_MAX
64
This is defined in file
krish@lin-hyd-dsk-07:~> grep HOST_NAME_MAX /usr/include/bits/local_lim.h
#define HOST_NAME_MAX 64″
smehta26 6:44 am on February 3, 2010
“If anyone wondered what is the max length of hostname you can use (solutions and guess over the internet already), but just itching to write down how to find out. Here’s how..
krish@lin-hyd-dsk-07:~> getconf HOST_NAME_MAX
64
This is defined in file
krish@lin-hyd-dsk-07:~> grep HOST_NAME_MAX /usr/include/bits/local_lim.h
#define HOST_NAME_MAX 64″