🔁 Reverse DNS란?
Reverse DNS는 일반적인 DNS의 반대 작업을 말합니다.
- ✅ 정방향 DNS (Forward DNS):
도메인 이름 → IP 주소
예: www.google.com → 142.250.206.132 - 🔁 역방향 DNS (Reverse DNS):
IP 주소 → 도메인 이름
예: 142.250.206.132 → seoul.google.com
📌 왜 사용하나요?
- 스팸 차단 (이메일 서버)
- 메일 서버는 발신 IP에 대해 rDNS 조회를 수행해, 올바른 도메인 이름이 등록되어 있는지를 확인합니다.
- 등록되지 않으면 스팸으로 간주될 수 있음.
- 로그 분석 / 보안 감시
- IP 대신 도메인 이름으로 어떤 서버가 연결되었는지 파악하기 쉬움.
- 예: 로그에 23.45.67.89 대신 mail.microsoft.com으로 표시.
- 트러블슈팅
- 네트워크 진단 시, 접속한 IP가 어떤 도메인을 사용하는지 알아야 할 때 유용.
🛠 어떻게 동작하나요?
rDNS는 특수한 DNS zone을 사용합니다.
→ in-addr.arpa (IPv4), ip6.arpa (IPv6)
예를 들어:
즉, IP 주소를 거꾸로 배열한 뒤, in-addr.arpa 도메인에서 PTR (Pointer Record) 을 조회합니다.
📎 정리하면
정의 | IP 주소 → 도메인 이름을 조회하는 DNS 기능 |
목적 | 이메일 인증, 보안, 트러블슈팅, 로깅 등 |
레코드 종류 | PTR 레코드 (Pointer Record) |
zone 도메인 | in-addr.arpa (IPv4) / ip6.arpa (IPv6) |
필요하다면 dig, nslookup 등의 명령어로 직접 테스트해볼 수도 있습니다. 예를 들어:
👉 결과: dns.google
🧭 in-addr.arpa는 누가 관리하나요?
1. 최상위 관리 기관:
- IANA (Internet Assigned Numbers Authority)
- arpa 최상위 도메인을 포함한 인터넷 네임스페이스 전체를 관리.
- in-addr.arpa의 루트 존도 이곳에서 시작됩니다.
- IANA는 ICANN(국제인터넷주소관리기구) 산하 조직입니다.
👉 따라서, in-addr.arpa의 최종 책임자는 IANA입니다.
🔗 실질적인 분산 관리 구조
2. RIRs (지역 인터넷 등록 기관)
IANA는 전체 IP 주소 블록을 **RIR (Regional Internet Registry)**에게 할당하고,
RIR은 각 IP 블록에 대한 rDNS (PTR 관리 포함) 권한도 함께 위임합니다.
예:
아시아 | APNIC | 한국, 일본, 중국 등 |
북미 | ARIN | 미국, 캐나다 |
유럽 | RIPE NCC | 유럽 전체 |
남미 | LACNIC | 남아메리카 |
아프리카 | AFRINIC | 아프리카 지역 |
3. LIR/ISP/기업
RIR은 다시 인터넷 서비스 제공자(ISP)나 대규모 기업에게 역방향 DNS 관리 권한을 위임합니다.
예를 들어:
- SK Broadband가 고객에게 123.123.0.0/16 대역을 할당하면,
- 그 안에 속한 IP에 대한 *.in-addr.arpa PTR 레코드 관리 권한도 위임될 수 있습니다.
📌 예시 흐름
요약
1 | IANA (ICANN) | in-addr.arpa 루트 관리 |
2 | RIRs (예: APNIC, ARIN) | IP 블록 및 rDNS 구역 위임 |
3 | LIR/ISP/기업 | 실제 PTR 레코드 설정 및 운영 |
in-addr.arpa 도메인과 역방향 DNS는 마치 트리(tree) 혹은 포레스트(forest) 구조처럼 계층적으로 구성되어 있습니다.
정확히는 DNS 트리 구조의 하위에 있는 별도의 서브트리 (역방향 네임스페이스) 형태라고 볼 수 있어요.
🌲 Forest처럼 구성된 이유
DNS 자체가 계층적 네임스페이스(Hierarchical Namespace) 기반이기 때문에
in-addr.arpa 도메인도 다음처럼 거꾸로 된 IP 구조에 따라 트리처럼 분기됩니다:
🧱 예시: 192.0.2.25
이 IP 주소를 역방향 DNS로 바꾸면?
이걸 구성하면 다음과 같은 트리 경로가 됩니다:
🗂️ 왜 이렇게 구성하나?
- 이 구조 덕분에 **위임(delegation)**이 매우 효율적입니다.
- 예를 들어, 192.in-addr.arpa 전체를 ARIN이 관리하고,
그 중 192.0.2.0/24 구간은 어떤 ISP에게 위임하면, 그 ISP가 2.0.192.in-addr.arpa 구간만 관리하면 됩니다. - IP 범위별로 독립적인 트리처럼 구역화되기 때문에 forest 구조와 매우 유사하게 보이는 겁니다.
🌳 IPv6는 더 깊은 트리 구조
IPv6는 128비트 주소라서, 역방향 DNS는 더 깊고 복잡한 트리를 사용합니다:
예:
IPv6 주소 2001:db8::567:89ab → 역방향 도메인:
→ 문자 하나씩 분리해서 128단계에 가까운 트리로 구성됩니다. 😮
🔍 정리
구조 | 계층적 트리 구조 (거꾸로 된 IP 기반) |
유사성 | 포레스트처럼 독립적 구간 위임 가능 |
활용 | IP 블록별 위임, DNS 효율성 증가 |
IPv4 vs IPv6 | IPv6는 더 깊은 트리 구조 가짐 |
Linux Free Command
✅ What does the free command do?
The free command in Linux is used to display information about the system's memory usage — including:
- Total RAM
- Used memory
- Free memory
- Shared memory
- Buffer/cache
- Swap memory
📘 Example Output of free:
🔍 Columns Explained:
- total: Total installed memory (RAM or swap).
- used: Memory in use by processes and the OS.
- free: Completely unused memory.
- shared: Memory used by tmpfs (shared memory).
- buff/cache: Memory used by the system for buffers and cache (can be reclaimed).
- available: Estimated memory available for starting new applications.
🧠 Summary:
The free command shows a snapshot of memory usage — it helps you understand:
- How much memory is in use
- How much is free
- How much is being used as cache
- And how much swap space is used or available
Let me know if you'd like a breakdown of a sample question using free outputs!
🧠 What is the dmesg command for?
The dmesg command in Linux is used to view kernel messages — especially useful for:
🔍 Primary Purpose:
dmesg shows messages from the kernel ring buffer, including:
- Boot logs
- Hardware detection (disks, USBs, RAM)
- Driver loading
- Kernel warnings or errors
📘 Common Use Cases:
View system boot logs | `dmesg |
Check USB device plug-in/out | `dmesg |
Debug hardware problems | `dmesg |
View new kernel messages live | `watch "dmesg |
🖥️ Sample Output:
📎 Notes:
- dmesg shows low-level kernel events; useful for admins, developers, or anyone troubleshooting hardware.
- Unlike journalctl, dmesg doesn’t store logs permanently — it only shows what’s in the current kernel buffer.
Let me know if you want to filter specific device events using dmesg!
What is the Linux last command?
The last command in Linux is used to show a list of the most recent login sessions on the system.
🔍 What does it do?
- Displays information about users who have logged in and out.
- Shows login time, logout time, and session duration.
- Can show reboots and shutdown events.
- Reads data from /var/log/wtmp (a binary file that logs login records).
Example usage:
Key points:
- Shows who logged in and when.
- Useful for auditing and monitoring user activity.
- You can specify a username to filter results:
-
bashCopyEditlast username
- Use last -n 10 to show only last 10 entries.
chmod 755 script.sh
User = 7 (4+2+1) → read, write, execute
Group = 5 (4+0+1) → read, execute
Others = 5 (4+0+1) → read, execute
What is /tmp?
- /tmp is a directory used for temporary files created by applications and the system.
- Files in /tmp are usually deleted on reboot or after some time.
- Many programs use /tmp to store temporary data.
Typical /tmp directory permissions:
If you run:
You’ll usually see something like:
Breaking down the permissions:
- d — directory
- rwxrwxrwt — permissions for user, group, and others:
- User (owner): rwx (read, write, execute)
- Group: rwx (read, write, execute)
- Others: rwx (read, write, execute)
- t (sticky bit) — special permission
What is the sticky bit (t)?
- The sticky bit on a directory means:
- Only the owner of a file inside /tmp or the root user can delete or rename that file.
- Other users cannot delete files owned by someone else, even though they have write permission on /tmp.
- This protects users’ temporary files from being accidentally or maliciously deleted by others.
Why /tmp has these permissions?
- /tmp needs to be writable by everyone so all users and programs can create temp files.
- The sticky bit ensures file security and ownership in a shared writable directory.
Summary:
/tmp | drwxrwxrwt | Writable by all, sticky bit set |
useradd -m tux
What it does:
- useradd: This command is used to create a new user account on a Linux system.
- -m: This option tells useradd to create a home directory for the new user if it doesn’t already exist.
- tux: This is the username of the new user you want to create.
Detailed explanation:
- When you run useradd -m tux, it will:
- Create a new user called tux.
- Create a home directory for tux at /home/tux.
- Copy default configuration files (like .bashrc, .profile) from /etc/skel into /home/tux.
- Set ownership of /home/tux to the user tux.
- Add an entry for tux in system files like /etc/passwd.
Summary:
useradd | Create a new user |
-m | Create the user’s home directory |
tux | Username of the new account |
What is the tar command?
- tar stands for tape archive.
- It's used to create, extract, and manage archive files (usually .tar files).
- It bundles multiple files/directories into a single file for easier storage or transfer.
- Often combined with compression tools like gzip or bzip2.
Common tar operations (subcommands/options)
-c | Create a new archive | tar -cf archive.tar file1 file2 |
-x | Extract files from an archive | tar -xf archive.tar |
-t | List contents of an archive | tar -tf archive.tar |
-v | Verbose mode (shows detailed output) | tar -cvf archive.tar folder/ |
-f | Specify the filename of the archive | tar -cf archive.tar file |
-z | Use gzip compression or decompression | tar -czf archive.tar.gz folder/ |
-j | Use bzip2 compression or decompression | tar -cjf archive.tar.bz2 folder/ |
Examples:
1. Create a gzip compressed archive of a folder:
- -c: create archive
- -z: gzip compression
- -v: verbose output
- -f: filename specified
2. Extract files from a gzip compressed archive:
- -x: extract
- -z: gzip decompression
- -v: verbose
- -f: filename
3. List contents of an archive:
- -t: list contents
- -f: filename
Summary:
-c | Create archive |
-x | Extract archive |
-t | List archive contents |
-v | Verbose (show details) |
-f | Archive filename |
-z | gzip compression |
-j | bzip2 compression |
'Server > Linux' 카테고리의 다른 글
Linux Essential Certification - 2 (0) | 2025.07.16 |
---|---|
Linux - 3 (0) | 2025.06.20 |
Linux - 2 (0) | 2025.06.11 |
Linux exam preparation & study (0) | 2025.04.17 |
리눅스강의 - 1 (0) | 2025.02.25 |