Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

CompTIA XK0-006 Exam - Topic 2 Question 3 Discussion

Posted by Rene on Mar 31, 2026 at 02:24 AM

A Linux administrator is testing a web application on a laboratory service and needs to temporarily allow DNS and HTTP/HTTPS traffic from the internal network. Which of the following commands will accomplish this task?

Suggested Answer: C

Comprehensive and Detailed Explanation From Exact Extract:

The correct way to temporarily allow specific services in a particular zone with firewalld is to use firewall-cmd --add-service=service --zone=zone. Multiple services can be specified in curly braces and separated by commas. The correct syntax is:

bash

CopyEdit

firewall-cmd --add-service={dns,http,https} --zone=internal

This command will allow DNS (port 53), HTTP (port 80), and HTTPS (port 443) through the firewall for the 'internal' zone temporarily (for the current runtime session).

Other options:

A . The command syntax is incorrect; firewalld is a service, not a command-line tool.

B . iptables does not use the --enable-service flag, nor does it have zones in this way.

D . systemctl mask disables services, and the rest of the command is invalid.


CompTIA Linux+ Study Guide: Exam XK0-006, Sybex, Chapter 9: 'Networking', Section: 'Managing Firewalls with firewalld'

CompTIA Linux+ XK0-006 Objectives, Domain 2.0: Networking

===========

Get Premium XK0-006 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
12 comments · newest first
AR
Arlette 3 months ago
Definitely C! It’s clear and straightforward for allowing those services.
ED
Edward 3 months ago
I feel like A could work too, but I’m not sure about the syntax.
TR
Tricia 3 months ago
I think option C is the right choice. It’s the correct syntax for firewall-cmd.
HA
Han 3 months ago
Isn't D just masking the service instead of allowing traffic?
MA
Marylou 3 months ago
Definitely C, I've used it before with no issues.
RE
Regenia 4 months ago
Wait, can you really use firewalld like that?
AL
Alex 5 months ago
I think A is better, more straightforward.
LA
Lashon 5 months ago
C is the right command for that!
LA
Latrice 6 months ago
I definitely remember that you can't mask services with systemctl like option D suggests, so that one is definitely out.
EL
Elly 6 months ago
I feel like I might have seen a question similar to this in our study group, but I can't recall if it was about iptables or firewalld.
JE
Jeanice 6 months ago
I remember practicing with firewall-cmd commands, and I think option C looks familiar. It seems to be the right format for adding services to a zone.
HE
Heike 7 months ago
I think the command should be related to firewalld since it's commonly used in modern Linux systems, but I'm not sure about the exact syntax.
0/2000 characters

Save Cancel