TCPRegistered PortFirewall: Usually Closed
9042

Apache Cassandra CQL

What is Port 9042?

Port 9042 is the default client port for Apache Cassandra's CQL (Cassandra Query Language) native transport protocol. CQL is Cassandra's primary interface for application queries, providing a SQL-like syntax for interacting with the distributed database. When applications connect to Cassandra using drivers (DataStax Java, Python, Go drivers), they connect to port 9042. CQL supports prepared statements, batch operations, user-defined types, and materialized views. The native transport protocol replaced the older Thrift interface (port 9160) as the recommended client connection method. Cassandra's CQL binary protocol is designed for efficiency, supporting frame-level multiplexing and asynchronous query execution.

Common Uses

  • Application connections to Cassandra database
  • CQL query execution and data manipulation
  • Cassandra driver connectivity
  • Database administration via cqlsh

Technical Details

Port Number9042
ProtocolTCP
CategoryRegistered
Service NameApache Cassandra CQL
Default FirewallUsually Closed
Port Test Commands

Copy-paste commands to check port 9042 (Apache Cassandra CQL) from your terminal

Test connectivity

Netcat (nc)Check if TCP port is reachable
nc -zv example.com 9042
curl (HTTP)Test HTTP response on this port
curl -v --max-time 5 http://example.com:9042/
TelnetBasic TCP port connectivity check
telnet example.com 9042
nmapScan port 9042 with service detection
nmap -p 9042 -sV example.com
Bash /dev/tcpPure bash TCP check (no extra tools needed)
(echo > /dev/tcp/example.com/9042) 2>/dev/null && echo "open" || echo "closed"

Open port in firewall

UFW (Ubuntu / Debian)
sudo ufw allow 9042/tcp
iptables
sudo iptables -A INPUT -p tcp --dport 9042 -j ACCEPT
firewalld (RHEL / CentOS)
sudo firewall-cmd --permanent --add-port=9042/tcp && sudo firewall-cmd --reload

Security Considerations

!

Enable authentication (PasswordAuthenticator or custom) and authorization (CassandraAuthorizer). Use TLS for client connections (client_encryption_options). Restrict port 9042 to application servers via firewall rules. Implement role-based access control. Never expose Cassandra directly to the internet.

Popular Ports Reference

The most commonly used and referenced network ports

Related Ports