update-gh-host

Update the local hosts file with GitHub IP mappings and flush DNS.

10|1|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/AndersHsueh/Office-Skills --skill update-gh-host
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: update-gh-host
Source: https://github.com/AndersHsueh/Office-Skills/tree/main/Office-Skills/skills/update-gh-host
Command: npx skills add https://github.com/AndersHsueh/Office-Skills --skill update-gh-host

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill updates the local hosts file to optimize GitHub access by mapping GitHub domains to optimal IP addresses, reducing latency and image load issues.

Core Features & Use Cases

  • Auto-update GitHub hosts: fetches latest GitHub IP mappings from primary and backup sources and updates the hosts file safely.
  • Backup and restore: backs up the existing hosts file before applying changes and can restore on error.
  • Cross-platform support: works on Windows, macOS, and Linux, including DNS cache flushing to apply changes instantly.
  • Use-case: for teams in regions with slow GitHub access or flaky image loading, run this to ensure GitHub resources resolve quickly.

Quick Start

Run update_gh_host.py to update the hosts file and flush DNS so GitHub resolves faster.

Frequently Asked Questions about update-gh-host

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix slow GitHub access and broken images by updating the hosts file?

To fix slow GitHub access and broken images, you can update your local hosts file to map GitHub domains to optimal IP addresses. This Skill automates that process by fetching the latest IP mappings from multiple sources and safely writing them to your hosts file.

Can I update the GitHub hosts file automatically on both Windows and macOS?

Yes, you can update the GitHub hosts file automatically on Windows, macOS, and Linux. The Skill provides cross-platform support and automatically flushes your DNS cache after modifying the hosts file so the changes take effect immediately.

Is it safe to modify the hosts file to speed up GitHub, and can I rollback changes?

Modifying the hosts file to speed up GitHub is safe because this Skill creates a backup of your existing hosts file before applying any changes. If an error occurs during the update, it automatically rolls back to the original file.

Why does GitHub still load slowly after I manually changed the hosts file?

GitHub might still load slowly after a manual hosts file change if your DNS cache hasn't been flushed. This Skill resolves the issue by automatically fetching fresh IP mappings and flushing your local DNS cache to ensure the new configurations apply instantly.

What is the best way to automate fetching GitHub IP addresses for the hosts file?

The best way to automate fetching GitHub IP addresses for the hosts file is using a script like this Skill, which retrieves content from primary and backup sources. It ensures you always have optimal IP mappings without manual lookup.

Do I need administrative privileges to run the update-gh-host script?

Yes, you need administrative privileges to run the update-gh-host script because modifying the system hosts file requires elevated permissions. This applies across Windows, macOS, and Linux environments to allow safe file modification and DNS cache flushing.