host name is optional.  pass nil to skip