Added trim() to cope with spaces around host nameS