DNS server in LAN
to use domain name(e.g. gitlab.com) in LAN rather than IP, it needs every local host machine to store all key-values:: host-IP. if the LAN has many host machines, it will be difficult to maintain. Setting up DNS server will help to automatically map the ip to domain or reverse in the LAN.
bind9
|
|
/etc/bind/db.ip2gitlab.com
ip2gitlab zone file is from ip to domain mapping,
|
|
nslookup
nslookup www.gitlab.com #dns forward (domain 2 ip)
nslookup 10.20.101.119 #reverse (ip 2 domain)
settings
if the DNS setted above(DNS-git) is the only DNS server in the LAN, then this DNS works like a gateway, to communicate by domain name, every local host talk to it first, to understand the domain name.
but in a large size company LAN newtwork, there may already has a DNS server hosted at IT department (DNS-IT), with a fixed IP e.g. 10.10.101.101
, and all localhost machines actually set DNS-IT as the default DNS. DNS-git will work as a sub-DNS server.
Inside the small team, either every localhost change default DNS to DNS-git, then DNS-git become the sub-network server.
if every localhost still keep DNS-IT, there is no way(?) to use DNS-git service in LAN, and even make conflicts, as the DNS-git localhost machine will listen on all TCP/IP ports, every new gitlab.com access request (input as IP address) will get an output as domain name, but the others can’t understand this domain-name…
what happened with two DNS server in LAN ?
how email works
Mail User Agent(MUA), e.g. Outlook, Foxmail, used to receive and send emails.
MUA is not directly sent emails to end users, but through Mail Transfer Agent(MTA), e.g. SendMail, Postfix.
an email sent out from MUA will go through one or more MTA, finally reach to Mail Delivery Agent(MDA), the email then store in some database, e.g. mailbox
the receiver then use MUA to review the email in the mailbox
ps, one day work as a IT admin ….