Application Layer Protocols (HTTP, DNS, SMTP, FTP) # MCQs Practice set

Q.1 Which protocol is primarily used for transferring web pages over the Internet?

FTP
HTTP
SMTP
DNS
Explanation - HTTP (HyperText Transfer Protocol) is used to transfer web pages from servers to browsers.
Correct answer is: HTTP

Q.2 What is the default port number for HTTP?

21
25
80
443
Explanation - The default port for HTTP is 80, while HTTPS uses port 443.
Correct answer is: 80

Q.3 Which protocol is used to send emails from a client to a server?

SMTP
FTP
DNS
HTTP
Explanation - SMTP (Simple Mail Transfer Protocol) is used for sending emails.
Correct answer is: SMTP

Q.4 Which of the following is a protocol used to resolve domain names to IP addresses?

DNS
HTTP
FTP
SMTP
Explanation - DNS (Domain Name System) translates domain names like 'example.com' into IP addresses.
Correct answer is: DNS

Q.5 Which protocol allows uploading and downloading files from a remote server?

FTP
SMTP
DNS
HTTP
Explanation - FTP (File Transfer Protocol) is designed to transfer files between a client and a server.
Correct answer is: FTP

Q.6 What is the default port for FTP data transfer?

20
21
22
23
Explanation - Port 20 is used for FTP data transfer, while port 21 is used for control commands.
Correct answer is: 20

Q.7 Which of the following protocols is connectionless?

HTTP
DNS
SMTP
FTP
Explanation - DNS typically uses UDP which is connectionless for fast query resolution.
Correct answer is: DNS

Q.8 Which protocol supports both ASCII and binary file transfers?

HTTP
SMTP
FTP
DNS
Explanation - FTP can transfer files in either ASCII or binary mode depending on the file type.
Correct answer is: FTP

Q.9 Which protocol uses the 'HELO' command during its operation?

SMTP
FTP
DNS
HTTP
Explanation - SMTP uses the 'HELO' or 'EHLO' command to identify the client to the mail server.
Correct answer is: SMTP

Q.10 HTTPS is the secure version of which protocol?

FTP
HTTP
SMTP
DNS
Explanation - HTTPS encrypts HTTP traffic using SSL/TLS for secure communication.
Correct answer is: HTTP

Q.11 Which of the following DNS record types maps a domain name to an IPv4 address?

MX
A
CNAME
PTR
Explanation - An 'A' (Address) record in DNS maps a domain name to its corresponding IPv4 address.
Correct answer is: A

Q.12 Which command in FTP is used to change the directory on the server?

PWD
CWD
LIST
GET
Explanation - CWD (Change Working Directory) command is used to navigate directories on the FTP server.
Correct answer is: CWD

Q.13 Which HTTP method is used to retrieve data from a server without making changes?

POST
GET
PUT
DELETE
Explanation - GET method requests data from a server and should not affect server state.
Correct answer is: GET

Q.14 Which SMTP command is used to terminate the mail session?

QUIT
HELO
MAIL FROM
RCPT TO
Explanation - QUIT command ends the SMTP session politely.
Correct answer is: QUIT

Q.15 Which of the following is true about DNS caching?

Reduces DNS query traffic
Slows down domain resolution
Increases server load
Prevents all DNS attacks
Explanation - DNS caching stores previous query results to reduce traffic and speed up resolution.
Correct answer is: Reduces DNS query traffic

Q.16 Which FTP mode establishes a data connection initiated by the client?

Active mode
Passive mode
Binary mode
ASCII mode
Explanation - In active mode, the client opens a port and waits for the server to connect for data transfer.
Correct answer is: Active mode

Q.17 Which of the following is a valid HTTP response status code for 'Not Found'?

200
301
404
500
Explanation - HTTP 404 status code indicates that the requested resource was not found on the server.
Correct answer is: 404

Q.18 Which command in SMTP specifies the recipient of an email?

MAIL FROM
RCPT TO
DATA
QUIT
Explanation - RCPT TO command specifies the recipient address for the email in SMTP protocol.
Correct answer is: RCPT TO

Q.19 Which of the following FTP commands retrieves a file from the server?

PUT
GET
LIST
PWD
Explanation - GET command downloads a file from the FTP server to the client machine.
Correct answer is: GET

Q.20 What type of DNS record specifies the mail server for a domain?

MX
A
CNAME
TXT
Explanation - MX (Mail Exchange) records indicate which server handles email for a domain.
Correct answer is: MX

Q.21 Which HTTP method is typically used to send data to a server to create a resource?

GET
POST
PUT
DELETE
Explanation - POST method submits data to the server, often creating a new resource.
Correct answer is: POST

Q.22 Which protocol is essential for resolving human-readable domain names to machine-readable IP addresses?

HTTP
DNS
SMTP
FTP
Explanation - DNS translates domain names into IP addresses that computers can understand.
Correct answer is: DNS

Q.23 Which FTP mode should be used if the client is behind a firewall preventing incoming connections?

Active mode
Passive mode
Binary mode
ASCII mode
Explanation - Passive mode allows the client to initiate both control and data connections, avoiding firewall issues.
Correct answer is: Passive mode

Q.24 Which header in an HTTP request specifies the browser or client type?

Host
User-Agent
Content-Type
Accept
Explanation - The 'User-Agent' header identifies the client software making the HTTP request.
Correct answer is: User-Agent

Q.25 Which command in SMTP begins the transfer of the actual email message content?

DATA
MAIL FROM
RCPT TO
QUIT
Explanation - The DATA command indicates that the lines following it contain the message content to be sent.
Correct answer is: DATA