Fleet logo
Menu An icon indicating that interacting with this button will open the navigation menu.
Fleet logo An 'X' icon indicating that this can be interacted with to close the navigation menu.
Multi platform
Device management   (+ MDM) Orchestration   (+ monitoring) Software management   (+ CVEs) Integrations

Docs
Stories
News Ask around Meetups Share your story COMPANY
The handbook Testimonials

Pricing Schedule a demo
Multi platform
Device management + MDM Orchestration + monitoring Software management + CVEs, usage, app library Integrations
Docs
Stories
News Ask around Meetups Schedule a demo Share your story COMPANY The handbook Testimonials
Pricing Try it yourself

Tables

Fleet uses osquery tables to query operating system, hardware, and software data. Each table provides specific data for analysis and filtering.

macOS Apple

Linux Linux

Windows Windows

Chrome ChromeOS

{{table.title}} evented table

etc_hosts

click to open the table of contents
macOS logo Windows logo Linux logo

etc​_hosts

The hosts file comprises a local, plain-text configuration for mapping IP addresses to host names. It does not necessarily rely on an external Domain Name System (DNS) for routing. The etc_hosts osquery table expresses the data in the hosts file.

Column Type Description
address text IP address mapping
hostnames text Raw hosts mapping
pid_with_namespace integer Pids that contain a namespace
Only available on Linux

Example

This query detects if the macOS /private/etc/hosts file has been modified from its default state:

SELECT * FROM etc_hosts WHERE address != '127.0.0.1' AND address != '::1' AND address != '255.255.255.255';

Notes

The hosts file is customized by many organizations. As part of a defense-in-depth security posture it's important to track hosts modifications. Endpoints with a modified hosts configuration connected to enterprise networks can potentially bypass network rules, proxies and firewalls or be routed to malicious sites.

File paths to hosts:

  • Linux: /etc/hosts
  • macOS: /private/etc/hosts
  • Windows: C:\Windows\system32\drivers\etc

More info:

  • DNS
  • The /etc/hosts Guide For Linux
  • How to edit the hosts file on Windows
Edit page

Questions?

Ask us anything
{{table.title}} evented table
Fleet logo
Multi platform Device management Orchestration Software management Integrations Pricing
Documentation Support Docs API Release notes Get your license
Company About News Jobs Logos/artwork Why open source?
ISO 27001 coming soon a small checkmarkSOC2 Type 2 Creative Commons Licence CC BY-SA 4.0
© 2025 Fleet Inc. Privacy
Slack logo GitHub logo LinkedIn logo X (Twitter) logo Youtube logo Mastadon logo
Tried Fleet yet?

Get started with Fleet

Start
continue
×