The only time it's OK to use http://localhost is in a single-server, development/test environment (when you are sure no other servers will ever be added to the farm). Otherwise you should always use a proper DNS URL.
Brian
Brian