Site1.local shows server not found

I created two sites site1.local and site2.local but when I try to open them in browser they show “server not found” but when I open localhost:8000 it opens the erpnext desk.So my question is why doesn’t site1.local:8000 works and localhost:8000 works instead and which site is localhot:8000 actually opening?
PS-I am very new to frappe so please don’t mind me asking this question.

adding host_name attriubute in your site_config.json might solve the issue please check.

e.g.

{ “db_name”: “xxxxxxxxxxxxx”,
“db_password”: “xxxxxxxxxxxx”,
“host_name”: “yourdomain.com” }

still getting server not found

Try this
bench setup add-domain mydomain.com --site [site]
bench config dns_multitenant on
bench setup nginx
sudo service nginx restart

Is it a development setup on your laptop?

In that case, have you added the site name to your hosts file?

If it’s a development server you can add multiple sites this way