LAN 클라이언트가 URL을 통해 내 웹사이트를 찾도록 하기

LAN 클라이언트가 URL을 통해 내 웹사이트를 찾도록 하기

Apache2가 설치되어 실행 중입니다. 나는 구성 파일을 만지작거렸고 다음도 발견했습니다.https://httpd.apache.org/docs/2.2/vhosts/examples.html

제가 방금 붙여넣은 그 웹사이트에서는 일부 'apache2' 구성 파일에 사이트 이름을 정의하여 사용자가 웹 브라우저에 해당 이름을 입력하고 사이트를 찾도록 만드는 것이 그렇게 쉽지 않다고 말합니다. 또한 사용 중인 DNS가 귀하의 사이트 URL이 무엇인지, 어떤 IP와 일치해야 하는지 또는 내가 이해하는 것과 유사한 것을 알려주는 데도 필요합니다(해당 페이지에서 제안됨).

이제 저는 Linux 상자가 클라이언트 PC에 네트워크 IP 번호를 제공하고 자체를 기본 게이트웨이로 설정하여 LAN에서 작업하고 있습니다. 설정하려면 DNS 구성을 어디에서 찾아야합니까? www.mywonderfulsite.com->192.168.1.1 (리눅스 상자) 말하자면. 이 글을 읽는 사람이 내가 달성하려는 목표를 이해하기를 바랍니다.

답변1

man dnsmasq부분적으로는 다음을 참조하세요 .

trusty (8) dnsmasq.8.gz
Provided by: dnsmasq-base_2.68-1_i386 bug

NAME

       dnsmasq - A lightweight DHCP and caching DNS server.

SYNOPSIS

       dnsmasq [OPTION]...

DESCRIPTION

       dnsmasq  is a lightweight DNS, TFTP, PXE, router advertisement and DHCP
       server. It is intended to provide coupled DNS and  DHCP  service  to  a
       LAN.

       Dnsmasq  accepts  DNS  queries  and  either  answers them from a small,
       local, cache or forwards them to a  real,  recursive,  DNS  server.  It
       loads  the  contents of /etc/hosts so that local hostnames which do not
       appear in the global DNS can be resolved and also answers  DNS  queries
       for  DHCP  configured  hosts.  It can also act as the authoritative DNS
       server for one or more domains, allowing local names to appear  in  the
       global DNS.

따라서 (각 클라이언트마다) 다음을 추가해야 하는 것 같습니다./etc/hosts

192.168.1.1 www.mywonderfulsite.com  

에 대한 다른 별칭은 192.168.1.1별도의 줄이 아닌 동일한 줄에 나타나야 합니다. 여러 줄에/etc/hosts같은IP 주소는 혼란, 당혹감, 좌절감을 불러일으키고 책상에 머리를 두드리는 일을 발생시킵니다.

관련 정보