While preparing a CentOS Stream 9 DNS server you must open port 53 for both UDP and TCP traffic in the public zone. The change has to survive daemon reloads and system reboots, and you want the most maintainable one-line rule (that is, you prefer a predefined abstraction to listing individual ports). Which single command accomplishes this goal?
firewalld ships with an XML definition called dns.xml that already lists both 53/tcp and 53/udp. Adding that service therefore opens the correct ports in one step. Including the --permanent switch writes the rule to the persistent configuration so it is still in place after a reload or reboot. The other commands fail at least one requirement: running without --permanent is lost after a restart; adding only one port leaves the other protocol blocked; specifying both ports manually works functionally but does not use the predefined service, so it is less maintainable than the requested approach.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the role of the '--permanent' flag in the firewall-cmd command?
Open an interactive chat with Bash
What is the difference between adding a 'service' and adding a 'port' in firewalld?
Open an interactive chat with Bash
What is the significance of the default 'public' zone in firewalld?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Security
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access