Inability to access erpnext with Hostname in Multitenant

Dear Friends,Help.
In my test environment i have changed my default site to and add host name have also created the second site as and the host name have added the host name ( to my site_config.json in the site and then bench setup nginx and then restart nginx.Unfortunately the nginx refused to be setup.Icannot access site www.fredoluka,com with
Pls note that i have enable dns multitenancy.
I cannot access any of the two sites.i set up production in the ubuntu 16.4 in local system and i have been exploring erpnext with access through Local host until i changed to the dns multi tenancy
This is the error from bench setup nginx
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/bench/”, line 40, in cli
File “/usr/local/lib/python2.7/dist-packages/click/”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/.bench/bench/commands/”, line 22, in setup_nginx
make_nginx_conf(bench_path=“.”, yes=yes)
File “/home/frappe/.bench/bench/config/”, line 13, in make_nginx_conf
sites = prepare_sites(config, bench_path)
File “/home/frappe/.bench/bench/config/”, line 61, in prepare_sites
sites_configs = get_sites_with_config(bench_path=bench_path)
File “/home/frappe/.bench/bench/config/”, line 151, in get_sites_with_config
site_config = get_site_config(site, bench_path=bench_path)
File “/home/frappe/.bench/bench/config/”, line 11, in get_site_config
return json.load(f)
File “/usr/lib/python2.7/json/”, line 291, in load
File “/usr/lib/python2.7/json/”, line 339, in loads
return _default_decoder.decode(s)
File “/usr/lib/python2.7/json/”, line 367, in decode
raise ValueError(errmsg(“Extra data”, s, end, len(s)))
ValueError: Extra data: line 20 column 2 - line 21 column 1 (char 391 - 421)
Kindly help

Dear Friends,
Any help?

Do you own both the top level domains?

What multi-tenancy does is help you do the following

2 sub-domains, 1 domain, 1 host.

Hope that helps.

Looks like the site config json format has errors.
Try using to validate json.

@Deepak_Pai Thanks for quick response.The domain names are created by me to just get access to the erpnext on lan environment and not over the internert.I just want to test the domain method of access the erpnext before moving to the digital ocean to subscribe hosting and then buy the domain name from godaddy.But i got stuck.I could not logged in through nor through the localhost.
I am sorry for bothering you.I just thought on LAN ,something like domain name can also be used to access erpnext if dns multitenency is enable.
Just need a guide to use multitenancy in local evironment if possible

What happens if you ping or trace route the 2 domains on your Lan:

tracert www.fredoluka.com1

Does it leave your LAN? if it does, your local DNS needs to be told to resolve these two hostnames to your ip address where the ERPNext is running (locally).

Hope that helps.

i have installed my ubuntiu in a local computer with the window server 2008 as the second OS,i have not joined the system to any network yet but just get access to my erpnext in the ubuntu when i have not enable the dns multitenency.So without joining any network the multitenancy will not work?Or how can i ping from the same system?Sorry for bothering you.

ok my friend. Either way, when you type in a web URL into your browser, your computer asks the DNS server (which is probably pointing it to an external DNS) what IP it should send packets to. There is a good chance that the DNS you are using either doesnt know where this ERPNext is or giving you an IP address that is not the ERPNext machine.

Thats why try this
tracert www.fredoluka.com1 (or traceroute in unix, google it pls)

And see what output it gives. And write back.

Thanks.This is the output of traceroute :traceroute: unknown host


To be able to acces any hostname from your local computer you need to add that domain to your local host/s file on both computers/servers that you will be accessing the ERPNext instances from.

On linux machines you will find your host file @


On windows machines @ (usually) and dependent on version please double check


The info you enter should be in the format:

The format applies to both Linux & Windows

Hope this helps

1 Like

sorry friend Saids, where can i find the /etc/hosts file .Any command from the bench to get the direction.I searched i did not see.

Its not in your bench.
/etc/hosts is on your Linux box.


You access it from your terminal by using this command

1. cd /etc/hosts
2. sudo nano /etc/hosts (nano is a linux text editor)
3. add the hostname/s as per above instructions
4. press ctrl + x
5. press y
6. hit return

You should see something like below when you enter nano text editor

1 Like