What does etchostsdeny do - CompTIA Linux + XK0-005

Question

What does /etc/hosts.deny do?

Answers
  1. correct
Explanation

The Correct Answer is: C. Blocks access via TCP wrappers
/etc/hosts.deny is a configuration file used by TCP wrappers, a host-based access control system for network services. It specifies which hosts or networks are explicitly denied access to services like sshd, telnet, or ftp that are linked with libwrap. When a connection request is received, the system checks hosts.allow first, and if there’s no match, it checks hosts.deny.

Why the other options are incorrect:

  • A. Denies DNS access
    DNS access is controlled through DNS server configurations or firewall rules, not through /etc/hosts.deny. This file does not affect how DNS requests are handled or resolved; its role is specific to TCP-wrapped services.

  • B. Lists blocked users
    This file does not manage user-based access. Instead, it works on a host-based level, blocking or allowing connections from specific IP addresses or hostnames. User access is typically controlled through PAM modules, /etc/passwd, or service-specific configuration files.

  • D. Stores host IPs
    While the file may contain host IPs as part of access rules, its primary purpose is not to store IP addresses, but to define policies that deny network access. IPs in this file are part of rule definitions, not a storage or lookup list.

Related Courses

Discover a range of courses designed to provide you with the knowledge and skills needed to excel in your chosen field.

a prepsaret exam featured image
CompTIA Prep

220-1201 - CompTIA A+ Exam Core 1

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

220-1202 - CompTIA A+ Exam Core 2

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA SecurityX CAS-005

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Cloud Essentials+ CLO-002

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Network+ N10-009

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Security+ SY0-701

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Data + DA0-001

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Pentest+

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA CySA+ CSO-003

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA DataSys+ DS0-001

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Tech+ FC0-U71

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Cloud+ CV0-004

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Server+ SK0-005

Start Course Prep

Easy way to pass your test within a week with prepsaret

You don’t need one month to study and pass your test.
With Prepsaret, it takes you a few days to grasp all the concepts needed to pass your exams

View Courses Offered