title: Cannot list muc rooms from ejabberd
body: <p>I'm stucked with an error on my ejabberd server.
  It seems that ejabberd want to list from conference.localhost and not from my real host conference.xmpp.mydomain.com.</p>
  
  <pre><code>2016-04-14 11:03:49.167 [info] &lt;0.982.0&gt;@ejabberd_s2s:new_connection:406 New s2s connection started &lt;0.992.0&gt;
  2016-04-14 11:03:49.168 [info] &lt;0.992.0&gt;@ejabberd_s2s_out:log_s2s_out:1253 Trying to open s2s connection: xmpp.mydomain.com -&gt; conference.localhost with TLS=true
  2016-04-14 11:03:49.183 [info] &lt;0.992.0&gt;@ejabberd_s2s_out:open_socket:246 s2s connection: xmpp.mydomain.com -&gt; conference.localhost (remote server not found)
  2016-04-14 11:03:51.939 [info] &lt;0.992.0&gt;@ejabberd_s2s_out:handle_info:940 Reconnect delay expired: Will now retry to connect to conference.localhost when needed.
  </code></pre>
  
  <p>Here is my ejabberd.yml [EDITED]:</p>
  
  <pre><code>websocket_ping_interval: 60
  websocket_timeout: 86400
  
  loglevel: 4
  log_rotate_size: 10485760
  log_rotate_date: ""
  log_rotate_count: 1
  
  hosts:
    - "xmpp.mydomain.com"
  
  listen: 
    - 
      port: 5222
      module: ejabberd_c2s
      max_stanza_size: 65536
      shaper: c2s_shaper
      access: c2s
    - 
      port: 5269
      module: ejabberd_s2s_in
  
    -
      port: 5280
      ip: "::"
      module: ejabberd_http
      hosts:
        - "xmpp.mydomain.com"
      request_handlers:
        "/websocket": ejabberd_http_ws
      web_admin: true
      http_bind: true
    -
      port: 5285
      module: ejabberd_http
      hosts:
        - "xmpp.mydomain.com"
      request_handlers:
         "/rest": mod_rest
  
  s2s_use_starttls: optional
  s2s_certfile: "/etc/ejabberd/ejabberd.pem"
  
  ##
  ## MySQL server:
  ##
  odbc_type: mysql
  odbc_server: "localhost"
  odbc_database: "ejabberd"
  odbc_username: "ejabberd"
  odbc_password: "pwd"
  
  shaper:
    normal: 1000
    fast: 50000
  
  max_fsm_queue: 1000
  
  ###.   ====================
  ###'   ACCESS CONTROL LISTS
  acl:    
    admin:
      user:
        - "admin": "xmpp.mydomain.com"
    local: 
      user_regexp: ""
  
    loopback:
      ip:
        - "127.0.0.0/8"
  
  ###.  ============
  ###'  ACCESS RULES
  access:
    ## Maximum number of simultaneous sessions allowed for a single user:
    max_user_sessions: 
      all: 10
    ## Maximum number of offline messages that users can have:
    max_user_offline_messages: 
      admin: 5000
      all: 100
    ## This rule allows access only for local users:
    local: 
      local: allow
    ## Only non-blocked users can use c2s connections:
    c2s: 
      blocked: deny
      all: allow
    ## For C2S connections, all users except admins use the "normal" shaper
    c2s_shaper: 
      admin: none
      all: normal
    ## All S2S connections use the "fast" shaper
    s2s_shaper: 
      all: fast
    ## Only admins can send announcement messages:
    announce: 
      admin: allow
    ## Only admins can use the configuration interface:
    configure: 
      admin: allow
    ## Admins of this server are also admins of the MUC service:
    muc_admin: 
      admin: allow
    ## Only accounts of the local ejabberd server can create rooms:
    muc_create: 
      local: allow
    ## All users are allowed to use the MUC service:
    muc: 
      all: allow
    ## Only accounts on the local ejabberd server can create Pubsub nodes:
    pubsub_createnode: 
      local: allow
    ## In-band registration allows registration of any possible username.
    ## To disable in-band registration, replace 'allow' with 'deny'.
    register: 
      all: allow
    ## Only allow to register from localhost
    trusted_network: 
      loopback: allow
  
  language: "en"
  
  ###.  =======
  ###'  MODULES
  
  modules: 
    mod_adhoc: {}
    mod_admin_extra: {}
    mod_announce: # recommends mod_adhoc
      access: announce
    mod_blocking: {} # requires mod_privacy
    mod_caps: {}
    mod_carboncopy: {}
    mod_client_state:
      drop_chat_states: true
      queue_presence: false
    mod_configure: {} # requires mod_adhoc
    mod_disco: {}
    ## mod_echo: {}
    mod_irc: {}
    mod_http_bind: {}
    ## mod_http_fileserver:
    ##   docroot: "/var/www"
    ##   accesslog: "/var/log/ejabberd/access.log"
    mod_last: 
      iqdisc: one_queue
      db_type: odbc
    mod_mam:
      iqdisc: one_queue
      db_type: odbc
      default: always
    mod_muc: 
      ## host: "conference.@HOST@"
      access: muc
      access_create: muc_create
      access_persistent: mud_create
      access_admin: muc_admin
      db_type: odbc
      default_room_options:
          mam: true
          public: false
          public_list: false
          allow_change_subj: false
          allow_user_invites: false
          members_only: false
          members_by_default: false
          anonymous: false
          allow_private_messages: true
          persistent: true
    mod_muc_admin: {}
    ## mod_muc_log: {}
    ## mod_multicast: {}
    mod_offline:
      db_type: odbc 
      access_max_user_messages: max_user_offline_messages
    mod_ping: {}
    ## mod_pres_counter:
    ##   count: 5
    ##   interval: 60
    mod_privacy: {}
    mod_private: {}
    ## mod_proxy65: {}
    mod_rest:
      allowed_ips: all
    mod_pubsub: 
      access_createnode: pubsub_createnode
      ## reduces resource comsumption, but XEP incompliant
      ignore_pep_from_offline: true
      ## XEP compliant, but increases resource comsumption
      ## ignore_pep_from_offline: false
      last_item_cache: false
      plugins: 
        - "flat"
        - "hometree"
        - "pep" # pep requires mod_caps
    mod_register: 
      welcome_message: 
        subject: "Welcome!"
        body: |-
          Hi.
          Welcome to this XMPP server.
  
      access: register
    mod_roster: {}
    mod_shared_roster: {}
    mod_stats: {}
    mod_time: {}
    mod_vcard: {}
    mod_version: {}
  </code></pre>
  
  <p>I used the same configuration on a other machine with no errors.
  I don't understand what I'm missing here</p>
  
  <p>Thanx for your help</p>
  
  <p>[EDIT] 18/04/2016 :
  1/ client :</p>
  
  <pre><code>&lt;iq from='j9albn7dju@xmpp.mydomain.com/null' to='xmpp.mydomain.com' type='get' xmlns='jabber:client' id='2:sendIQ'&gt;
  &lt;query xmlns='http://jabber.org/protocol/disco#items'/&gt;
  &lt;/iq&gt; 
  </code></pre>
  
  <p>2/ server :</p>
  
  <pre><code>&lt;iq xmlns='jabber:client' from='xmpp.mydomain.com' to='j9albn7dju@xmpp.mydomain.com/null' id='2:sendIQ' type='result'&gt;
  &lt;query xmlns='http://jabber.org/protocol/disco#items'&gt;
  &lt;item jid='conference.xmpp.mydomain.com'/&gt;
  &lt;item jid='echo.xmpp.mydomain.com'/&gt;
  &lt;item jid='irc.xmpp.mydomain.com'/&gt;
  &lt;item jid='pubsub.xmpp.mydomain.com'/&gt;
  &lt;/query&gt;
  &lt;/iq&gt; 
  </code></pre>
  
  <p>3/ client :</p>
  
  <pre><code>&lt;iq to='conference.xmpp.mydomain.com' from='j9albn7dju@xmpp.mydomain.com/null' type='get' xmlns='jabber:client' id='78:sendIQ'&gt;
  &lt;query xmlns='http://jabber.org/protocol/disco#items'/&gt;
  &lt;/iq&gt;
  </code></pre>
  
  <p>4/ server :</p>
  
  <pre><code>&lt;iq xmlns='jabber:client' from='conference.xmpp.mydomain.com' to='j9albn7dju@xmpp.mydomain.com/null' id='78:sendIQ' type='result'&gt;
  &lt;query xmlns='http://jabber.org/protocol/disco#items'&gt;
  &lt;item jid='conference.localhost' node='emptyrooms' name='Empty Rooms'/&gt;
  &lt;/query&gt;
  &lt;/iq&gt;
  </code></pre>