How should /etc/hosts be configured?

Hallo,

I've installed ejabberd on my ubuntu server following this tutorial:

https://help.ubuntu.com/community/SettingUpJabberServer

. When I then want to add the password to the created admin user (sudo ejabberdctl register admin-name example.com password) I get the following error message:

Failed RPC connection to the node ejabberd@example: nodedown

I've found this workaround

http://askubuntu.com/a/205566/3291

but don't get the point. How should I configure my /etc/hosts? What should I do?

My /etc/hosts:

127.0.0.1       example.com localhost
127.0.1.1       example.com

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

/etc/hosts 127.0.0.1      

/etc/hosts

127.0.0.1       localhost
192.168.1.10   foobar.ddns.net foobar
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

/etc/hostname

foobar

/etc/ejabberd/ejabberd.cfg

...

%% Admin user
{acl, admin, {user, "admin", "foobar.ddns.net"}}.

%% Hostname
{hosts, ["foobar.ddns.net"]}.

...

192.168.1.10 = my server-ip
foobar = my local server name
foobar.ddns.net = my domain (i use a free-dns from noip.org)

Don't forget to reboot after editing '/etc/hosts' or '/etc/hostname'.
You also need to do a 'ejabberdctl restart' after editing the ejabberd.cfg.

This worked! Thanks a lot!

This worked! Thanks a lot!

Syndicate content