Skip to content

About

Discover Netflix's Open Connect Appliance (OCA) assigned to your connection. This tool fetches and displays detailed connectivity and hosting information, facilitating optimized content delivery network (CDN) performance analysis.

Resources

Code of conduct

Contributing

Security policy

Stars

27 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

67 Commits

Folders and files

Repository files navigation

🌐 Netflix OCA Locator

A modern, feature-rich CLI tool to discover Netflix's Open Connect Appliances (OCAs) allocated to your network. Built with Python, this tool provides detailed insights into Netflix's content delivery infrastructure and helps you understand how Netflix optimizes streaming performance for your location.

CI Docker Python 3.10+ License: MIT

✨ Features

  • πŸ” Automatic OCA Discovery: Identifies Netflix OCAs serving your network
  • 🌍 Enhanced Geolocation: Advanced location resolution using TheAleph API with fallback to standard geocoding
  • πŸ“Š Rich Terminal Output: Beautiful CLI with colors, emojis, and tables
  • πŸ“ Multiple Export Formats: JSON, CSV, Excel, and Markdown exports
  • πŸ—ΊοΈ Interactive Maps: Generate HTML maps showing OCA locations
  • 🐳 Docker Support: Ephemeral containers with auto-cleanup and volume mounting
  • ⚑ Async Performance: Fast, concurrent API calls
  • πŸ”’ Robust Error Handling: Comprehensive retry logic and graceful degradation
  • πŸ“ Detailed Logging: Configurable logging with file output
  • βš™οΈ Flexible Configuration: Environment variables and settings files

πŸš€ Quick Start

Installation

Using uv (recommended):

# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone and install
git clone https://github.com/estcarisimo/Netflix-OCA-Servers-Locator.git
cd Netflix-OCA-Servers-Locator
uv sync

Traditional pip installation:

git clone https://github.com/estcarisimo/Netflix-OCA-Servers-Locator.git
cd Netflix-OCA-Servers-Locator
pip install -e .

Note: this package is not published to PyPI β€” pip install netflix-oca-locator will not work. Install from a clone, as shown above.

System Requirements

  • Python 3.10 or higher

  • The whois command-line tool:

    # Ubuntu/Debian
    sudo apt-get install whois
    
    # macOS β€” included with the OS at /usr/bin/whois
    brew install whois   # only if you want a newer version
    
    # Alpine
    apk add whois
    
    # Windows (via WSL or Git Bash)
    # whois is usually available by default

πŸ“– Usage

Basic Usage

source .venv/bin/activate
# Discover OCAs for your network
netflix-oca-locator main

# Quiet mode (minimal output)
netflix-oca-locator main --quiet

# Enable debug logging
netflix-oca-locator main --debug

Export Results

# Export to JSON
netflix-oca-locator main --output json --output-file results.json

# Export to CSV
netflix-oca-locator main --output csv

# Export to Excel with multiple sheets
netflix-oca-locator main --output xlsx

# Export to Markdown
netflix-oca-locator main --output markdown

Generate Maps

# Generate interactive HTML map
netflix-oca-locator main --map

# Generate and open map in browser
netflix-oca-locator main --open-map

Additional Commands

# Show version information
netflix-oca-locator version

# Show detailed application info
netflix-oca-locator info

# Show help
netflix-oca-locator --help

🐳 Docker Usage

Quick Docker Setup

# Build the Docker image
docker build -t netflix-oca-locator .

# Run with output preservation
docker run --rm -v $(pwd)/output:/app/output netflix-oca-locator main

# Export to JSON
docker run --rm -v $(pwd)/results:/app/output netflix-oca-locator main --output json

# Generate map and export data
docker run --rm -v $(pwd)/maps:/app/output netflix-oca-locator main --map --output csv

Using the Helper Script

# Make the script executable
chmod +x run-docker.sh

# Basic usage
./run-docker.sh run

# Export to JSON with custom output directory
./run-docker.sh -o /tmp/oca-results run --output json

# Generate map with debug mode
./run-docker.sh -d run --map --output csv

# Build image only
./run-docker.sh build

# Interactive shell for debugging
./run-docker.sh shell

Docker Compose

# Basic run
docker-compose run --rm netflix-oca-locator main --output json

# With environment variables
NETFLIX_OCA_DEBUG=true docker-compose run --rm netflix-oca-locator main --debug

# Development mode
docker-compose --profile dev run --rm netflix-oca-locator-dev

Docker Features

  • Ephemeral Containers: Automatically removed after execution
  • Volume Mounting: Preserve output files on host system
  • Environment Variables: Configure via Docker environment
  • Multi-architecture: Supports AMD64 and ARM64
  • Lightweight: Optimized Alpine Linux base (<100MB)
  • Security: Non-root user execution

πŸ”§ Configuration

Geocoding Configuration

The application supports multiple geocoding providers for enhanced location accuracy:

  • hybrid (default): Uses TheAleph API first, falls back to standard geocoding
  • aleph: Uses only TheAleph API for geocoding
  • geopy: Uses only standard geocoding (Nominatim)
# Set geocoding provider
export NETFLIX_OCA_GEOCODING_PROVIDER=hybrid

Environment Variables

Configure the application using environment variables with the NETFLIX_OCA_ prefix:

export NETFLIX_OCA_DEBUG=true
export NETFLIX_OCA_LOG_LEVEL=DEBUG
export NETFLIX_OCA_LOG_FILE=/var/log/netflix-oca.log
export NETFLIX_OCA_REQUEST_TIMEOUT=60
export NETFLIX_OCA_MAX_RETRIES=5
export NETFLIX_OCA_GEOCODING_PROVIDER=hybrid

Configuration File

Create a .env file in the project directory:

NETFLIX_OCA_DEBUG=false
NETFLIX_OCA_LOG_LEVEL=INFO
NETFLIX_OCA_SHOW_EMOJI=true
NETFLIX_OCA_MAP_ZOOM=4
NETFLIX_OCA_EXPORT_PATH=./exports
NETFLIX_OCA_GEOCODING_PROVIDER=hybrid

πŸ—οΈ Architecture

The application is built with a modular architecture:

src/netflix_oca_locator/
β”œβ”€β”€ api/                    # External API integrations
β”‚   β”œβ”€β”€ fast_com.py         # Fast.com API client
β”‚   β”œβ”€β”€ ip_services.py      # IP and ISP lookup services
β”‚   └── dns_resolver.py     # IPv4/IPv6 DNS resolution and NAT64 handling
β”œβ”€β”€ cli/                    # Command-line interface
β”‚   └── interface.py        # Typer-based CLI
β”œβ”€β”€ core/                   # Business logic
β”‚   β”œβ”€β”€ models.py           # Pydantic data models
β”‚   └── oca_locator.py      # Main orchestration logic
β”œβ”€β”€ utils/                  # Utility modules
β”‚   β”œβ”€β”€ aleph_geocoding.py  # TheAleph client and hybrid fallback chain
β”‚   β”œβ”€β”€ formatters.py       # Export formatters
β”‚   β”œβ”€β”€ geocoding.py        # Location services
β”‚   β”œβ”€β”€ logging.py          # Logging configuration
β”‚   └── mapping.py          # Map generation
└── config/                 # Configuration management
    └── settings.py         # Pydantic settings

πŸ§ͺ Development

Setup Development Environment

# Clone repository
git clone https://github.com/estcarisimo/Netflix-OCA-Servers-Locator.git
cd Netflix-OCA-Servers-Locator

# Install with development dependencies
uv sync --dev
# ...or, without uv:  pip install -e ".[dev]"

# Install pre-commit hooks (ruff lint + format on staged files)
uv run pre-commit install

Running Tests

# Run all tests
uv run pytest

# Run with coverage
uv run pytest --cov=netflix_oca_locator --cov-report=term-missing

# Run specific test file
uv run pytest tests/test_core/test_models.py -v

Tests never make real network calls. Coverage currently sits at about 24%, concentrated in core/models.py and config/settings.py β€” the CLI and the api/ clients are not covered yet, and contributions there are especially welcome.

Code Quality

# Lint with ruff
uv run ruff check .

# Format code
uv run ruff format .

# Type checking
uv run mypy src/

ruff check and ruff format are enforced in CI. mypy is advisory: there is a backlog of pre-existing type errors, so the CI step does not fail on them. Please don't add new ones. See CONTRIBUTING.md for the details.

Building

# Build package
uv build

# Test installation
uv pip install dist/*.whl

πŸ“Š Example Output

╔═══════════════════════════════════════════════════════════╗
β•‘         🌐 Netflix OCA Locator v2.1.0 🌐                  β•‘
β•‘                                                           β•‘
β•‘  Discover Netflix's Open Connect Appliances serving       β•‘
β•‘  your network for optimal streaming performance           β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

🌐 Your Network Information
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Public IP: 203.0.113.1                                 β”‚
β”‚ ISP: Example ISP                                       β”‚
β”‚ AS Number: AS64512                                     β”‚
β”‚ Country: US                                            β”‚
β”‚ BGP Prefix: 203.0.113.0/24                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🌐 Netflix OCA Servers Allocated to Your Network
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Domain                                           ┃ IP Address      ┃ Location       ┃ IATA ┃ ASN  ┃ Provider        ┃ Method   ┃
┑━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
β”‚ ipv4-c006-mke002-wiscnet-isp.1.oca.nflxvideo.net β”‚ 205.213.110.229 β”‚ Unknown        β”‚ -    β”‚ 2381 β”‚ WISCNET1-AS, US β”‚ thealeph β”‚
β”‚ ipv4-c211-ord001-dev-ix.1.oca.nflxvideo.net      β”‚ 45.57.120.66    β”‚ πŸ“ Chicago, IL β”‚ ORD  β”‚ 2906 β”‚ AS-SSI, US      β”‚ thealeph β”‚
β”‚ ipv4-c152-ord003-ix.1.oca.nflxvideo.net          β”‚ 23.246.37.204   β”‚ πŸ“ Chicago, IL β”‚ ORD  β”‚ 2906 β”‚ AS-SSI, US      β”‚ thealeph β”‚
β”‚ ipv4-c158-ord003-ix.1.oca.nflxvideo.net          β”‚ 23.246.36.133   β”‚ πŸ“ Chicago, IL β”‚ ORD  β”‚ 2906 β”‚ AS-SSI, US      β”‚ thealeph β”‚
β”‚ ipv4-c153-ord001-dev-ix.1.oca.nflxvideo.net      β”‚ 45.57.121.13    β”‚ πŸ“ Chicago, IL β”‚ ORD  β”‚ 2906 β”‚ AS-SSI, US      β”‚ thealeph β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Found 5 OCA server(s)

🀝 Contributing

We welcome contributions! Please see the Contributing Guidelines for setup instructions, the development workflow, and what to include in a bug report.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Project documentation

Document Contents
CONTRIBUTING.md Development setup, workflow, PR expectations
CHANGELOG.md Release history
AGENTS.md Guidance for AI coding agents working in this repo
SECURITY.md Vulnerability reporting, and what data this tool handles
CODE_OF_CONDUCT.md Community standards
docs/THEALEPH_IPV6_SUPPORT.md IPv6 and NAT64 implementation notes
CITATION.cff Citation metadata for research use

πŸ“ Citation

If you use Netflix OCA Locator in your research, please cite it. GitHub's "Cite this repository" button reads CITATION.cff.

@software{carisimo2026netflixoca,
  author  = {Carisimo, Esteban},
  title   = {Netflix {OCA} Locator},
  year    = {2026},
  version = {2.1.0},
  url     = {https://github.com/estcarisimo/Netflix-OCA-Servers-Locator},
  license = {MIT}
}

The geolocation approach uses TheAleph. That work has its own paper; see Enhanced Geocoding Attribution below.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ”— Related Resources

πŸ™ Acknowledgements

  • Netflix for providing the Fast.com infrastructure that makes this tool possible
  • Team Cymru for WHOIS services that provide ASN and ISP information
  • TheAleph.ai for enhanced geocoding and network intelligence services
  • The Python Community for excellent libraries that power this application

Enhanced Geocoding Attribution

This application uses TheAleph API (https://thealeph.ai) for enhanced geocoding and location resolution of network infrastructure. TheAleph provides superior accuracy for CDN and network node geolocation compared to standard geocoding services.

TheAleph Research Citation

TheAleph is based on cutting-edge research in DNS PTR record analysis using Large Language Models:

Paper: "The Aleph: Decoding DNS PTR Records With Large Language Models" Authors: Kedar Thiagarajan, Esteban Carisimo, and FabiΓ‘n E. Bustamante Conference: ACM CoNEXT, December 2025 Link: https://estcarisimo.github.io/assets/pdf/papers/2025-the-aleph.pdf

Integration Details

This implementation leverages TheAleph's ability to analyze PTR records and ASN information to provide enhanced location resolution for Netflix OCA servers. The system combines:

  • DNS PTR record analysis for infrastructure mapping
  • ASN (Autonomous System Number) correlation for network topology understanding
  • Large Language Model inference for location extraction from network naming conventions
  • Fallback to traditional geocoding services for comprehensive coverage

Advanced Features

The application includes advanced networking support and security features:

  • IPv6 Support: Intelligent handling of IPv6 domains with NAT64 detection and PTR record analysis
  • HTTPS Security: Full SSL certificate validation for secure API communications
  • Hybrid Fallback: Multi-tier fallback system ensuring reliable location resolution

For comprehensive technical details about IPv6 support, NAT64 handling, and implementation specifications, see the Technical Documentation.

Note: TheAleph API integration now uses full HTTPS security with SSL certificate validation enabled.


Note: This tool is for educational and network analysis purposes. Please use responsibly and in accordance with Netflix's terms of service.

About

Discover Netflix's Open Connect Appliance (OCA) assigned to your connection. This tool fetches and displays detailed connectivity and hosting information, facilitating optimized content delivery network (CDN) performance analysis.

Resources

Code of conduct

Contributing

Security policy

Stars

27 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages