Can't bind to DNS name

I don't know why this code said 'localhost', that's a known no-no. We use 127.0.0.1 in other places; safe to bind and to connect to, on all systems, without opening external ports.