Hostnames and MQ Explorer

I haven’t blogged about my day job for a while, but an interesting technical issue came up today.

A customer was trying to add a new queue manager to MQ Explorer. However, they could not enter the hostname into the relevant field in the GUI.

It turned out that the hostname had_an_underscore character in it. The entry field in MQ Explorer prevents the user from entering this character.

This restriction makes sense. As per several RFCs (RFC952, RFC1035, RFC1178) and the Wikipedia entry on hostnames, underscores_are_not_valid characters in hostnames.

… hostname labels can only be made up of the ASCII letters ‘a’ through ‘z’ (case-insensitive), the digits ‘0’ through ‘9’, and the hyphen. Labels can not start nor end with a hyphen. Special characters other than the hyphen (and the dot between labels) are not allowed, although they are sometimes used anyway. Underscore characters are commonly used by Windows systems but according to RFC 952 they are not allowed…

So, now you know.

A solution could be to reference the IP address of the queue manager in question, or possibly to alias the hostname in the hosts file so that it does not contain underscores. Note that I have not tested the latter solution, but it should work.

Leave a Reply