docker-magento icon indicating copy to clipboard operation
docker-magento copied to clipboard

magento.test’s server IP address could not be found.

Open jcroftpradco opened this issue 1 year ago • 2 comments

I have followed your instructions from "Set up Magento with the automated onelinesetup script" video.

I was able to successfully install Magento. When I typed bin/magento -V it returned: "Magento CLI 2.4.7"

but when I go to https://magento.test/ I get the following error:

This site can’t be reached magento.test’s server IP address could not be found. Try:

Checking the connection Checking the proxy, firewall, and DNS configuration ERR_NAME_NOT_RESOLVED

magento container in docker is running.

thanks for you help

jcroftpradco avatar May 08 '24 18:05 jcroftpradco

I got this fixed by editing my /etc/hosts file. I put my IP address and magento.test on one in the hosts file. thanks

jcroftpradco avatar May 09 '24 21:05 jcroftpradco

Hi @jcroftpradco,

It's bizarre because the one-liner should do this.

In the future, you can use the bin/setup-domain script, it adds a domain entry to the /etc/hosts file if it is not there.

YevhenZvieriev avatar May 09 '24 21:05 YevhenZvieriev

This solution only works if you are running the browser on the same device as the docker host. The additional step required if your browser is running from a different machine, is to create an entry in your local hosts file manually. e.g. Add this to the hosts file:

aaa.bbb.ccc.ddd magento.test

where aaa.bbb.ccc.ddd is replaced by the IP address of your host running docker, and

magento.test references with the hostname that you wish to use

itnavigate avatar Jul 25 '24 01:07 itnavigate

This solution only works if you are running the browser on the same device as the docker host. The additional step required if your browser is running from a different machine, is to create an entry in your local hosts file manually. e.g. Add this to the hosts file:

aaa.bbb.ccc.ddd magento.test

where aaa.bbb.ccc.ddd is replaced by the IP address of your host running docker, and

magento.test references with the hostname that you wish to use

You saved my life!

mblaw1011 avatar Aug 01 '24 06:08 mblaw1011

I have added in hosts file but still it is not working for me.

my hosts file looks like below -

[network]

generateHosts = false

127.0.0.1 localhost 127.0.1.1 Mousam. Mousam

The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 127.0.0.1 magento.test

devmousam avatar Aug 03 '24 21:08 devmousam

All you need in your /etc/hosts file is:

127.0.0.1 ::1 magento.test

Or, replace magento.test with whatever domain you set up is. 127.0.0.1 is your local machine, and ::1 is the ipv6 address of the same (or so I think it is?). That's all you need and it should be good to go.

The install does this out of the box, so I'm closing out this issue as unable to replicate.

markshust avatar Aug 22 '24 23:08 markshust

Thank you @markshust , actually I was adding in the wrong file. We need to add in this file - C:\Windows\System32\drivers\etc\hosts

My issue is resolved.

devmousam avatar Aug 29 '24 15:08 devmousam