krish – 起死回生 [Wake up from death & return to life.]

December 7, 2009

Max Hostname length on linux

Filed under: GNU/Linux — krish @ 9:15 pm
Tags: ,

Ever wanted to name a server with amazon-ec2 naming convention?
I hope not!

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

The Single Unix Specification version 2 (SuSv2) guarantees ‘Host names are limited to 255 bytes’. POSIX 1003.1-2001 guarantees ‘Host names (not including the terminating NULL) are limited to HOST_NAME_MAX bytes’.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Please leave a Reply / Discuss this topic here :)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

The Male Factor

On behalf of the ignored gender

Rough Draft

by Atteris Amarth and Darrek Ringo

The Kochi Post.

Read by all + Influenced by none

JumboMake

A signature of Kiran

SAAYAM CHEDDAM FOUNDATION

This blog is just for additional and extension share of it's main frames. No activity is planned from here

krish - 起死回生 [Wake up from death & return to life.]

Get a sneak peek into krish's life, work and passion.

WordPress.com

WordPress.com is the best place for your personal blog or business site.

A Tale of Two and a Half

Monika Amita Bakshi

%d bloggers like this: