i using archlinux , installed systemd-nspawn container:
the host , containers both have httpd installed.
in host server port 80
in container server port 81
what observered 127.0.0.1:80 refers host , 127.0.0.1:81 refers container.
i think default linux considers 127.0.0.1 127.0.0.1:80
i thought of saving 127.0.0.1:81 localhost in /etc/hosts
my file /etc/hosts in container follows: 127.0.0.1:81 gauranga 127.0.0.1 nityananda
when try in containers chroium http://gauranga ways this webpage not available
when try in containers chromium http://nityananda works , shows hosts /srv/http root directory contents
how resolve this.
the /etc/hosts file override or define local dns resolution on machine.
dns service translates domain names ip addresses computers can communicate each other.
ports concept. ports more mailboxes, computer can have more 1 service ( smtp , http , https etc.. ) , each of them listens on own special mailbox. way different services don't have access each others data.
in other words when connect google.com:80 1. first resolving google.com ip address 2. use ip connect 80 port or mailbox, 1 used web/http
so in short don't need ( , can't) specify port on /etc/hosts host entry have effect on ports since done in previous step.
Comments
Post a Comment