Set up the FTP server for file backup on CentOS 7


1. Install vsftpd on the server


1
yum install -y vsftpd

cs


2. Edit the configuration of vsftpd


1
vi /etc/vsftpd/vsftpd.conf
cs


 Here is my config file >>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
# When SELinux is enforcing check for SE bool ftp_home_dir
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
# When SELinux is enforcing check for SE bool allow_ftpd_anon_write, allow_ftpd_full_access
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
xferlog_file=/var/log/xferlog
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd/banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
chroot_local_user=YES
allow_writeable_chroot=YES
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd/chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
# Make sure, that one of the listen options is commented !!
listen_ipv6=NO
 
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
 
idle_session_timeout=600
use_localtime=YES
force_dot_files=YES
max_clients=2
max_per_ip=2
 
cs


3. open the port on firewalld


1
2
3
firewall-cmd --permanent --add-service=ftp
firewall-cmd --permanent --add-port=21/tcp
firewall-cmd --reload
cs


 If you want to check the port is accurately opened >>

1
firewall-cmd --list-port

cs


4. Create user for ftp client and set to nologin


1
2
3
4
5
useradd ftp_user
passwd ftp_user
 
usermod -/sbin/nologin ftp1
chmod +rw -/home/ftp_user

cs


and create the chroot_list file for ftp user login list, write the ftp user name on it

1
vi /etc/vsftpd/chroot_list
cs


5. Done. Start/restart the vsftpd daemon and connect via FTP client like 'Filezilla'


1
systemctl restart vsftpd
cs


'System Engineering > Linux' 카테고리의 다른 글

SSH security settings  (0) 2018.07.27
HTTP Header Sample Analysis - www.daum.net  (0) 2018.07.24
Linux: swap  (0) 2018.06.11
리눅스 Core dump  (0) 2018.05.24
리눅스마스터 1급 2차 노트  (0) 2017.04.17

SWAP partition in Linux, similar with virtual memory in Windows.


When the memory got out of range, the program will be located in swap partition.

But the speed is slower than the RAM because swap partition is on the disk.


Goods

-Give more memory spaces to insufficient RAM

-Allocate the program that is need fast memory


Bads

-Can not control the portion of swap dynamically

-Increase disk usage

-Does not always lead performance enhancement

'System Engineering > Linux' 카테고리의 다른 글

HTTP Header Sample Analysis - www.daum.net  (0) 2018.07.24
FTP server set up  (0) 2018.06.16
리눅스 Core dump  (0) 2018.05.24
리눅스마스터 1급 2차 노트  (0) 2017.04.17
리눅스 시스템 프로그래밍 노트  (0) 2017.02.02

http

Hyper Text Transfer Protocol


https

-http over secure socket layer.

-http using SSL.


Data communication over http could be read or altered by someone. To overcome this security issue, https uses public key encrpytion.

SSL was developed by Netscape, and changed name to TLS for IETF management. But SSL is popular than TLS.

SSL is digital document for certification by 3rd person.

SSL uses Symmetric key crpytosystem for data and Public key crpytosystem for symmetric key.


http를 통한 데이터 통신은 누군가에 의해 감청될 수 있다. 이를 극복하기 위해 등장한것이 https이다.

Netscape 사가 SSL을 개발했고, IETF에서 표준 관리를 위해 TLS라는 이름으로 변경했다.

SSL은 제 3자 인증을 위한 전자 문서다. 데이터 암호화에 대칭키 방식이 사용되며, 대칭키를 암호화 하기 위해 공개키 방식이 사용된다.


SSL's purposes:

-Ensure that the server which is connected with client is trusted.

-Provide a SSL public key to the client.


SSL은 클라이언트와 연결된 서버를 보증하고, SSL 공개키를 클라이언트에 제공하는 것이 주 목적이다.


SSL CA: Certificate Athority.

Includes service information(CA, service domain, etc) and server's public-key.


SSL에서 CA란 접속하려는 서버의 공개키와 제공하는 서비스에 대한 정보(CA, 서비스 도메인 등)를 포함한다. 


Browser already knows the CA list and each public-key.


웹 브라우저에는 사전에 공인된 CA 목록과 공개키를 가지고 있다.


모든 요청과 응답 데이터는 네트워크로 보내기 전에 암호화되며, 전송 레벨 암호 보안 계층이 있어 SSL 또는 TLS를 이용하여 구현한다. 서버 포트는 443번을 기본값으로 사용한다.

-       서버 인증서

n  인증서 일련번호

n  유효기간

n  사이트 조직 이름

n  DNS 호스트 명

n  공개키

n  인증서 발급기관(CA – Certificate Authority)

n  발급자 서명

HTTPS 트랜잭션 시작 시, 브라우저는 서버에서 디지털 인증서를 가져온다. 서버에 인증서가 없으면 보안 커넥션은 실패한다.

브라우저는 인증서의 서명 기관을 검사하고, 가지고 있는 공개키로 검증한다. 브라우저가 알 수 없는 기관이라면 사용자에게 확인한다.

HTTP

어플리케이션

SSL / TLS

보안

TCP

전송

IP

네트워크

NI

데이터링크

HTTPS

-       인증서 검사

n  유효 기간 확인

n  CA 신뢰도 검사: 브라우저의 CA 리스트와 비교

n  서명 검사: 공개키를 서명에 적용, 체크섬과 비교해 무결성 검사

n  사이트 신원 검사: 인증서의 도메인과 실제 대화중인 서버 호스트 명 검사

가상호스팅 인증서
가상 호스팅의 경우 인증서에 나열된 호스트명으로 리디렉션을 통해 보안 프로토콜 지원


'System Engineering > Network' 카테고리의 다른 글

HTTP 1. HTTP  (0) 2018.07.02
Protocol: TCP and UDP  (0) 2018.06.18
HAProxy – 오픈 소스 로드 밸런서  (0) 2018.05.24
포트 미러링  (0) 2018.05.24
Difference between each layer  (0) 2018.05.16

Web Server

 Client로 부터 요청을 받아 정적인 페이지 컨텐츠(html, jpeg, css 등) 제공

 Apache, NGINX, IIS 등


WAS

 DB 조회, 로직처리 등 동적 컨텐츠 제공을 위해 만들어진 application server

 Tomcat, Jeus, JBoss, Web Sphere 등


-정적인 컨텐츠 요청 시 WAS 단독으로는 성능이 느릴 수 있다. 따라서 Web Server에 WAS들을 plugin 형태로 설정하여 효율적으로 처리되도록 한다.

'System Engineering' 카테고리의 다른 글

RAID  (0) 2018.06.18
Netbackup 개념  (0) 2018.05.24

-디렉토리를 등록하여 백업


-각 센터 백업 어플라이언스 구축 후 WAN Replication 후 PTL 저장


-SAN Backup : FC. DB, 주요 시스템, 빠른 백업/복구 필요한 시스템 (8G)


-Network Backup: Ethernet. FS, 중요도 낮은 시스템 (1G, 10G)


-Off-host Backup: FC. DB


-파일 백업:. 매일/주 1회/매월 마지막일 FULL BACKUP


-Oracle DB: 증분/FULL

'System Engineering' 카테고리의 다른 글

RAID  (0) 2018.06.18
WEB WAS 개념  (0) 2018.05.24

로드 밸런싱 : 부하 분산을 위해서 Virtual IP를 통해 여러 서버로 접속하도록 분배하는 기능

주요 기능

 -NAT: 사설 IP를 공인 IP로 바꾸는데 사용하는 주소 변조기

 -DSR(Dynamic Source Routing protocol): 클라이언트로 응답하는 경우에 스위치를 거치지 않고 바로 클라이언트로 찾아가는 개념

 -Tunneling: 데이터를 캡슐화 하여 연결된 상호간에만 캡슐화된 패킷을 구별해 캡슐 해제

동작 방식

 -Bridge/Transparent Mode

  1. 요청 전달 시 변조

   사용자 > L4 > NAT(IP/MAC 변조) > real server

  2. 응답 전달 시 변조

   real server > NAT > L4 > 사용자 - source IP를 L4 virtual IP로 변조. MAC은 변조하지 않음


 -Router Mode

  Bridge/Transparent Mode와 유사. Source MAC 변조 포함


 -One Arm Mode

  사용자가 real server 접근 시 목적지 IP는 L4 IP를 바라보며, L4에 도달하면 클라이언트에게 받은 목적지 IP를 L4 IP에서 real server IP와 real server MAC으로 변조. 되돌아가는 IP는 L4의 IP Pool의 IP로 변조


 -DSR(Direct Server Return) Mode

  사용자가 real server 접근 시 출발지와 목적지 IP 변조 없이 L4에서 관리하는 real server의 MAC addr table 확인하여 MAC 주소만 변조


HAProxy 동작 방식

기본적으로 reverse proxy 형태로 동작. 브라우저에서 사용되는 일반적인 proxy의 경우, 클라이언트 앞에서 처리하는 기능으로, forward proxy라 함. Reverse proxy의 역할은 real server 요청에 대해 서버 앞 단에 존재하면서 서버로 들어오는 요청을 대신 받아 서버에 전달하고 그 결과를 다시 전달하는 것.


최초 접근 > 응답 시 쿠키에 서버 정보 추가 > 재요청 시 클라이언트가 가지고 있는 쿠키 정보를 proxy에서 확인하여 요청 > 응답 시 쿠키에 정보 추가 없고 이후 요청 시 쿠키 재사용


XFF (X-Forwarded-For) header

HTTP header 중 하나로 client의 IP 식별을 위한 사실상의 표준

WAS 앞의 L4 등의 LB나 Proxy, Caching, WAS Connector 등이 있을 경우 HTTP나 AJP(전용 프로토콜)

로 요청을 보낸 후 받은 결과를 가공하여 클라이언트에 재전송하기 때문에 웹서버나 WAS에서 request.getRemoteAddr(); 등으로 client IP를 얻게 되는데 원하는 결과가 아니므로 이를 해결하기 위해서 사용하는것이 XFF Header 이다. 콤마 구분자로 client IP와 proxy IP를 식별할 수 있다


HA 구성

Virtual Router Redundancy Protocol 지원으로 성능상 초당 8만 건 정도의 연결 처리 가능

소프트웨어 기반 솔루션이기 때문에 HAProxy 설치 서버에 문제 발생 시 HW L4보다는 불안정

HA 구성으로 master HAProxy에 문제가 생겨도 slave HAProxy에서 서비스 제공하도록 구성


vIP를 공유하는 active HAProxy와 stnadby HAProxy가 heartbeat를 주고받으며 서로 체크


단일 HAProxy와 다른점은 최초 접근 시 서버 정보를 쿠키가 아닌 서버에서 jsessionid 전달 시 합쳐서 전달한다

쿠키에 정보 추가 없이 XFF에 정보 추가 > 쿠키 추가 없음 > Jsessionid 추가 > 서버 정보 + jsessionid 쿠키에 추가 > 쿠키에서 서버 판별 후 jsessionid만 전달


L4 + HAProxy HA 구성

HAProxy와 기존 HW 스위치를 이용하여 더 확장된 형태의 HA 구조 설계

클라이언트에서 연결되는 부분은 vIP + L4 구성으로 HW 이중화 구축

L4에서 서버 앞단에 HAProxy 구축


GSLB (Global Service Load Balancing) + HAProxy

IDC간 이중화 및 global 환경 무정지 서비스를 위한 DR 시스템 구축

GSLB용 L4는 고가의 장비이므로 DNS를 이용한 구축 형태

client에서 DNS 도메인 조회 > 근거리 IDC 정보 전달


ref: http://d2.naver.com/helloworld/284659

'System Engineering > Network' 카테고리의 다른 글

Protocol: TCP and UDP  (0) 2018.06.18
About https  (0) 2018.06.11
포트 미러링  (0) 2018.05.24
Difference between each layer  (0) 2018.05.16
What is DNS?  (0) 2018.05.02

-네트워크 스위치의 한 포트에서 보이는 모든 네트워크 패킷 혹은 전체 VLAN의 모든 패킷들을 다른 모니터링 포트로 복제하는데 사용.


-IDS, 패시브 프로브 또는 Application Performance Management에 필요한 Real User Monitoring 기술과 같이 네트워크 트래픽을 모니터링 해야하는 네트워크 장비에서 사용.


-시스코 – Switched Port Analyzer / Remote Switched Port Analyzer


-네트워크 상의 데이터 분석 및 디버그, 오류 진단에 사용. 인바운드/아웃바운드 트래픽을 N:N으로 미러링 가능

'System Engineering > Network' 카테고리의 다른 글

About https  (0) 2018.06.11
HAProxy – 오픈 소스 로드 밸런서  (0) 2018.05.24
Difference between each layer  (0) 2018.05.16
What is DNS?  (0) 2018.05.02
CCNA note  (0) 2017.03.20

"Core dump"란 UNIX 계열에서 프로그램이 비정상적으로 종료되는 경우에 프로그램이 종료될 당시의 메모리 상태를 기록하여 생성된 파일을 말합니다. 이 파일은 해당 프로그램에 어떤 문제가 있었는지 디버깅 하는 용도로 사용된다고 합니다.

그러면 왜 error 나 log 등의 이름이 아닌가 하면, DRAM 반도체를 사용하지 않던 시절에는 "Magnetic Core Memory" 라는 RAM을 사용했고, 그 이름이 아직까지 이어져 사용되고 있다고 합니다.


Magnetic core memory에 대하여 설명하자면,

전자기기, 안테나 등에 자주 사용되는 Ferrite(페라이트) 자성체로된 고리에 케이블이 통과하는 모양의 격자 구조로 되어있는 메모리 입니다. 코어 1개가 1비트의 저장용량을 지니며, 한 코어에 읽기 케이블 1가닥, 쓰기 케이블 2가닥이 지나갑니다. 각 케이블에 전류를 흘려 해당 코어들에 자화를 일으켜 전류 방향에 따라 0 또는 1을 기록하는 방식입니다.


또한 Core dump 파일은 크기가 매우 커서 계속 생성되도록 하면 디스크 용량을 계속 차지하기

 때문에 생기지 않도록 막는것이 보통이라고 합니다. 따라서 이름에 core가 들어갔지만 삭제해도 시스템에 영향을 미치는 파일이 아니고 오히려 파일 시스템 관리 측면에서 정리 대상 우선순위가 높은 파일이라 할 수 있습니다.



echo “source <(kubectl completion bash | sed s/kubectl/k/g)” >> ~/.basgrc

'System Engineering > Linux' 카테고리의 다른 글

FTP server set up  (0) 2018.06.16
Linux: swap  (0) 2018.06.11
리눅스마스터 1급 2차 노트  (0) 2017.04.17
리눅스 시스템 프로그래밍 노트  (0) 2017.02.02
리마 1급 1차 노트  (0) 2017.01.31

- Layer 2 Data link layer (Ethernet)

Unit : Frame

Header : Includes MAC address of source and destination

Source broad casts the data and can receive data who has destination MAC address.



- Layer 3 Network Layer (IP)

Unit : Packet

Header : Includes IP addresses of source and destination

Use routing to distinct the network.

Routing table has IP and route information to find best route.



- Layer 4

Transport Layer (TCP/UDP)

Header : Use port to networking. http, ftp, smtp etc

Load balancing on the server farm environment



- Layer 7

Application Layer

To overcome L4's limitation.

Using more informations to networking : Data payloads (IP, port, URL, cookies, FTP file name, SSL ID, virus pattern etc)

'System Engineering > Network' 카테고리의 다른 글

About https  (0) 2018.06.11
HAProxy – 오픈 소스 로드 밸런서  (0) 2018.05.24
포트 미러링  (0) 2018.05.24
What is DNS?  (0) 2018.05.02
CCNA note  (0) 2017.03.20

DNS

Domain Name System(server)


네트워크 상의 도메인 이름을 IP 주소를 매핑해 주는 시스템초기에 호스트 네임 별로 IP 주소 정보를 시스템의 hosts.txt 파일로 관리하던 것이 기술이 발달하고 관리 대상이 증가함에 따라분산 구조로 관리가 가능하게 개발된 시스템이다.

DNS Components

Domain Name Space

DNS에서 사용할 데이터 자료구조를 정의하는 항목이다도메인 네임 스페이스는 도메인 네임을 중복되지 않게 네임을 생성하여 사용하도록 정의된 구성체계이다최상위 루트 도메인을 시작으로 트리 구조의 네임 체계를 이루며, DNS에서 하나의 도메인 네임은 유일한 값이다
  
상위 노드와 그 노드 아래로 연결된 공간을 모두 상위 노드의 도메인이라고 한다노드에 레이블을 붙여 노드를 구분하는데 루트 도메인 계층인 루트 도메인의 레이블은 null’이다모든 도메인은 루트 도메인으로부터 시작한다루트 도메인 네임은 하위 도메인들을 분배할당한다.

TLD (Top Level Domain)

 루트 도메인 계층 하위에 해당하는 계층으로국가 할당 도메인과 국제적 업체 할당 도메인으로 분류된다.

     -country code TLD: 국가를 나타내고하위 도메인들은 그 성격을 나타내는 도메인 네임을 사용한다.
-generic TLD: 국가 단위가 아닌국제적 단위로 사용되는 도메인으로전 세계를 기준으로 비영리상업적지역별 등 목적에 따라 분류된다


Second Level Domain

도메인 등록 조직이나 국가에 속하는 기관의 성격으로 분류된다. gTLD 하위의 경우 최종 사용자(개인이나 조직) 호스트 네임을 사용하여 도메인을 등록할 수 있다.


최종적으로 호스트 네임과 도메인 네임을 합쳐(Fully Qualified Domain Name) 완성된다. FQDN이 아닌 부분적인 경로만으로 식별 가능한 Partially Qualified Domain Name을 사용하기도 한다이는 하나의 도메인 안에서만 사용할 수 있으며, w.naver.com 이라는 FQDN에서 w PQDN이 된다일반적으로 루트 도메인의 마지막에 오는 점은 주로 생략하며, DNS에서는 마지막에 오는 점을 사용하면 FQDN으로 인식한다.
  
레이블은 기업의 이름 등 특정 단어로 만든다. ccTLD 하위의 경우에는 호스트와 조직의 성격을 나타내는 도메인이 위치한다.


Sub Domain

SLD에서 최종 사용자가 정의한 도메인일 경우서브 도메인으로서사용자 필요에 따라 만든 하위 도메인이다사용자 목적에 따라 도메인 네임 스페이스를 분할하여 웹 서버 도메인을 www.naver.com, café.naver.com, ns1.naver.com 등으로 나누어 사용할 수 있다.

Third Level Domain

SLD 하위 도메인으로, 사용자가 등록할 도메인



Name Server

도메인 zone에 속하는 노드들의 정보를 리소스 레코드로 정의하여 저장한 호스트를 네임 서버라고 하며, 1개 이상이 존재한다. 해당 도메인 존의 정보를 가진 마스터 네임 서버와 보조로 슬레이브 네임 서버가 있다. 해당 도메인 존에 속하는 네임에 대한 질의가 올 경우 해당 도메인 존의 하위 네임 서버 주소를 응답하여 질의를 유도한다.


Resolver

웹 브라우저 등의 DNS 클라이언트의 요청을 name server로 전달하고도메인 네임과 IP 주소를 받아 클라이언트에게 제공하는 기능을 수행한다. DNS 서버에 resolver 기능을 구현하고클라이언트에는 resolver routine을 구현하여 단말 시스템 자원 한계 등의 제약을 극복한다. Stub resolver 각 네임 서버의 구조를 파악할 필요 없이 resolver가 구현된 네임 서버의 IP 주소만 파악하면 된다


Resource Record (RR)

 리소스 레코드는 도메인 네임에 설정할 수 있는 데이터 타입이다도메인 네임을 키 값으로 하여 이를 도메인 네임에 필요한 데이터를 설정하는데사전에 정의된 데이터 타입과 포맷으로 해야 한다도메인 네임과 IP 주소 매치를 위해 사용된다

  -A 리소스 레코드: Host Address란 의미로 도메인 네임에 매치되는 IPv4를 정의한다

Name 

Class 

TTL 

Type 

Address 

www.naver.com 

IN 

 

202.xxx.xx.xxx 

Ø  Class: IN(InterNet) 외에도 있지만 현재 대부분 IN사용
  TTL: 
요청된 리소스 리코드는 TTL에 명시된 시간 소요 후 삭제되어 재요청이 필요생략 시 SOA 리소스 레코드에 정의된 default TTL 적용 

Ø  NS (Name Server) 리소스 레코드도메인 존의 네임서버를 정의

Ø  CNAME 리소스 레코드: Canonical Name. 도메인 네임에 별칭을 매치해당 도메인 네임에 대한 리소스 레코드를 동일하게 접근하여 사용하므로정보를 CNAME이 상속받는다
   ex) www.naver.com IN CNAME naver.com 
참조 시 naver.com 리소스 레코드를 참조하여 정보를 반환한다

-SOA 리소스 레코드: Start of a zone Of Authority. 존에 대한 권한 시작을 의미하나의 도메인 존에 반드시 하나의 SOA가 존재하는 특수 레코드로도메인 존의 default 설정과 마스터 네임 서버 지정 등에 사용된다

Name 

TTL 

Class 

Type 

Master NS 

Responsible person 

Serial; Refresh; Retry; Expire; Minimum; 

naver.com 

 

IN 

SOA 

ns.naver.com 

admin.ns.naver.com 

(

Name: 상위 도메인 존에게 위임 받은 도메인 존의 도메인 네임 
  
마스터 네임 서버: NS 리소스 레코드와 A 리소스 레코드를 통해 도메인 존에 대한 리소스 레코드 생성변경삭제 등의 권한을 위임 받음
  Responsible person: 
도메인 존 관리 담당자 메일 주소 
  Serial: 
도메인 존 파일에 대한 버전 정보정보 변경 시 증가이 값을 기반으로 슬레이브 네임 서버가 마스터 네임서버의 최신 리소스 레코드 정보를 획득한다
  Refresh: 
슬레이브 네임 서버가 마스터 네임서버에 도메인 존 파일 버전을 질의하는 초단위 시간으로해당 시간만큼 대기 후 마스터에 질의 
  Retry: 
슬레이브 네임 서버가 마스터 네임 서버에 질의 실패 시 재시도 하는 초 단위 시간으로 Refresh 보다 작은 값 작성 
  Expire: 
슬레이브 네임 서버가 질의 실패 시 마스터로부터 얻은 정보의 유효 시간 초 단위 작성해당 도메인 존에 대한 질의 무시 
  Minimum: 
도메인 존 파일에 있는 리소스 레코드들의 default TTL 값 작성(초 단위

SOA 끝 필드의 각 설정 값들은 기본 초 단위이며, D, H, W로 각각 일시간주로 작성 가능하다.


-MX 리소스 레코드: 수신 메일  서버를 정의. 호스트명이나 도메인 네임으로만 정의가 가능하다. IP 주소 입력 시 도메인으로 인식하여 존재하지 않는 도메인이 되어버린다. 레코드 입력 시 마지막에 . 붙인 FQDN 사용한다.


DNS work flow


how-route-53-routes-traffic

ref: https://aws.amazon.com/ko/route53/what-is-dns/


1. Enter the domain on web browser

2. Find the IP address of the domain from local - ISP DNS resolver

3. ISP DNS resolver requests the IP address to DNS root name server.

   DNS root server replies the TLD (Top Level Domain) server.

4. Try the domain to TLD server. (ex. .com, .kr, .jp, .net...)

   TLD server replies the name server of the domain.

5. Request to the name server

6. Name server response with IP address of the domain

7. DNS resolver response with the IP address to browser

8. Browser request to the webserver with IP address, port, and URL

9. Web server responses to the end user

'System Engineering > Network' 카테고리의 다른 글

About https  (0) 2018.06.11
HAProxy – 오픈 소스 로드 밸런서  (0) 2018.05.24
포트 미러링  (0) 2018.05.24
Difference between each layer  (0) 2018.05.16
CCNA note  (0) 2017.03.20

+ Recent posts