{"id":23782554,"url":"https://github.com/roydejong/wslhostsupdater","last_synced_at":"2026-05-15T01:05:04.787Z","repository":{"id":78205643,"uuid":"464947452","full_name":"roydejong/WSLHostsUpdater","owner":"roydejong","description":"Windows service that automatically manages hosts entries for your Windows Subsystem for Linux (WSL) instance.","archived":false,"fork":false,"pushed_at":"2023-01-25T12:05:59.000Z","size":101,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-01T12:17:31.409Z","etag":null,"topics":["hosts","service","windows","wsl","wsl-ubuntu","wsl2"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roydejong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-01T15:23:09.000Z","updated_at":"2023-03-05T13:22:57.000Z","dependencies_parsed_at":"2023-05-17T22:45:11.331Z","dependency_job_id":null,"html_url":"https://github.com/roydejong/WSLHostsUpdater","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roydejong%2FWSLHostsUpdater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roydejong%2FWSLHostsUpdater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roydejong%2FWSLHostsUpdater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roydejong%2FWSLHostsUpdater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roydejong","download_url":"https://codeload.github.com/roydejong/WSLHostsUpdater/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239993877,"owners_count":19730778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hosts","service","windows","wsl","wsl-ubuntu","wsl2"],"created_at":"2025-01-01T12:16:09.342Z","updated_at":"2025-11-11T01:03:56.515Z","avatar_url":"https://github.com/roydejong.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WSL Hosts Updater\n**Windows service that automatically manages `hosts` entries for your Windows Subsystem for Linux (WSL) instance.**\n\n## Features\n- Lightweight Windows service\n- Periodically checks your default WSL instance's status and IP\n- Automatically updates `hosts` entries with the instance's IP address\n- Keeps your hosts file clean and only ever adds one line per host\n\n## Installation\n\n✅ [**Download the latest build from GitHub**](https://github.com/roydejong/WSLHostsUpdater/releases/latest) (or build from source if you prefer)\n\nYou can either run the program manually, or install it as a Windows Service. Either way, you'll need administrator permissions so the `hosts` file can be edited.\n\n### Service installation\nPlace the files in a permanent directory, then use `sc` on the command line to install the Windows service:\n\n```\nsc.exe create \"WSLHostsUpdater\" binpath=\"\u003cSET_YOUR_INSTALL_PATH\u003e\\WSLHostsUpdater.exe\" start=delayed-auto obj=\u003cSET_YOUR_WINDOWS_ACCOUNT\u003e password=\u003cSET_YOUR_WINDOWS_PASSWORD\u003e\n```\n\nAfter this, you'll be able to see and manage the service from the Windows Services view. Warnings and errors will appear in the event viewer with `WSLHostsUpdater` as source.\n\n## Configuration\nYou can modify `appsettings.json` (must be in the same directory as the executable) to configure some aspects of the service:\n\n```json\n{\n  \"Logging\": {\n    \"LogLevel\": {\n      \"Default\": \"Information\",\n      \"Microsoft.Hosting.Lifetime\": \"Information\"\n    }\n  },\n  \"Service\": {\n    \"CheckWslRunning\": true,\n    \"UpdateInterval\": 30000,\n    \"Hostnames\": [\"host1.com\", \"host2.com\"]\n  }\n}\n```\n\n| Key               | Description                                                          | Default                       |\n|-------------------|----------------------------------------------------------------------|-------------------------------|\n| `CheckWslRunning` | If true, check if WSL is running first before attempting to refresh. | `true`                        |\n| `UpdateInterval`  | The amount of time in milliseconds between refreshes.                | `30000` (30 seconds)          |\n| `Hostnames`       | Array of host names to update in the `hosts` file.                   | `[\"wsl.local\", \"ubuntu.wsl\"]` |\n\n🕑 The configuration file is hot reloaded automatically, so you can add hostnames whenever you like without having to restart the service.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froydejong%2Fwslhostsupdater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froydejong%2Fwslhostsupdater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froydejong%2Fwslhostsupdater/lists"}