title: How can I make ActiveMQ use global hostname instead of hostname.local?
body: <p>I am running ActiveMQ on two machines. I am seeing machine1 uses hostname which I get from terminal</p>
  
  <pre><code>$ hostname
  NILSWAP01
  </code></pre>
  
  <p>I see it in the logs too.</p>
  
  <pre><code>INFO | Apache ActiveMQ 5.15.10 (localhost, ID:NILSWAP01-60292-1574286577214-0:1) is starting
  INFO | Listening for connections at: tcp://NILSWAP01:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600
  </code></pre>
  
  <p>But on my other machine, I see it uses <code>hostname.local</code> instead of a regular hostname.</p>
  
  <pre><code>$ hostname
  NILSWAP02
  </code></pre>
  
  <pre><code>INFO | Apache ActiveMQ 5.15.10 (localhost, ID:NILSWAP02.local-60292-1574286577214-0:1) is starting
  INFO | Listening for connections at: tcp://NILSWAP02.local:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600
  </code></pre>
  
  <p>Why is this happening? How can I ensure that my second machine also uses just regular global hostname?</p>
  
  <p>I am using the macOS 10.14.6.</p>
  
  <p>Broker configuration:</p>
  
  <pre><code>&lt;!--
          The &lt;broker&gt; element is used to configure the ActiveMQ broker.
      --&gt;
      &lt;broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}"&gt;
  
          &lt;destinationPolicy&gt;
              &lt;policyMap&gt;
                &lt;policyEntries&gt;
                  &lt;policyEntry topic="&gt;" &gt;
                      &lt;!-- The constantPendingMessageLimitStrategy is used to prevent
                           slow topic consumers to block producers and affect other consumers
                           by limiting the number of messages that are retained
                           For more information, see:
  
                           http://activemq.apache.org/slow-consumer-handling.html
  
                      --&gt;
                    &lt;pendingMessageLimitStrategy&gt;
                      &lt;constantPendingMessageLimitStrategy limit="1000"/&gt;
                    &lt;/pendingMessageLimitStrategy&gt;
                  &lt;/policyEntry&gt;
                &lt;/policyEntries&gt;
              &lt;/policyMap&gt;
          &lt;/destinationPolicy&gt;
  
  
          &lt;!--
              The managementContext is used to configure how ActiveMQ is exposed in
              JMX. By default, ActiveMQ uses the MBean server that is started by
              the JVM. For more information, see:
  
              http://activemq.apache.org/jmx.html
          --&gt;
          &lt;managementContext&gt;
              &lt;managementContext createConnector="false"/&gt;
          &lt;/managementContext&gt;
  
          &lt;!--
              Configure message persistence for the broker. The default persistence
              mechanism is the KahaDB store (identified by the kahaDB tag).
              For more information, see:
  
              http://activemq.apache.org/persistence.html
          --&gt;
          &lt;persistenceAdapter&gt;
              &lt;kahaDB directory="${activemq.data}/kahadb"/&gt;
          &lt;/persistenceAdapter&gt;
  
  
            &lt;!--
              The systemUsage controls the maximum amount of space the broker will
              use before disabling caching and/or slowing down producers. For more information, see:
              http://activemq.apache.org/producer-flow-control.html
            --&gt;
            &lt;systemUsage&gt;
              &lt;systemUsage&gt;
                  &lt;memoryUsage&gt;
                      &lt;memoryUsage percentOfJvmHeap="70" /&gt;
                  &lt;/memoryUsage&gt;
                  &lt;storeUsage&gt;
                      &lt;storeUsage limit="100 gb"/&gt;
                  &lt;/storeUsage&gt;
                  &lt;tempUsage&gt;
                      &lt;tempUsage limit="50 gb"/&gt;
                  &lt;/tempUsage&gt;
              &lt;/systemUsage&gt;
          &lt;/systemUsage&gt;
  
          &lt;!--
              The transport connectors expose ActiveMQ over a given protocol to
              clients and other brokers. For more information, see:
  
              http://activemq.apache.org/configuring-transports.html
          --&gt;
          &lt;transportConnectors&gt;
              &lt;!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB --&gt;
              &lt;transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt;
              &lt;transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt;
              &lt;transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt;
              &lt;transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt;
              &lt;transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;amp;wireFormat.maxFrameSize=104857600"/&gt;
          &lt;/transportConnectors&gt;
  
          &lt;!-- destroy the spring context on shutdown to stop jetty --&gt;
          &lt;shutdownHooks&gt;
              &lt;bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" /&gt;
          &lt;/shutdownHooks&gt;
  
      &lt;/broker&gt;
  </code></pre>