works with hostname [example: cf0.cs.uga.edu]

replace 1024 with #define BUFFER 1024, tested on cf0.cs.uga.edu