{"id":16840052,"url":"https://github.com/senorprogrammer/sdns","last_synced_at":"2026-04-24T16:32:36.728Z","repository":{"id":66611652,"uuid":"81792974","full_name":"senorprogrammer/sdns","owner":"senorprogrammer","description":"A command-line DNS switcher for macOS: 'sdns switch google'.","archived":false,"fork":false,"pushed_at":"2017-03-03T18:50:37.000Z","size":652,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T10:31:32.702Z","etag":null,"topics":["crystal","dns","macos"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/senorprogrammer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-02-13T06:35:56.000Z","updated_at":"2018-11-22T08:30:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"814a4681-45bc-48b3-b671-bac7071d3201","html_url":"https://github.com/senorprogrammer/sdns","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/senorprogrammer/sdns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senorprogrammer%2Fsdns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senorprogrammer%2Fsdns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senorprogrammer%2Fsdns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senorprogrammer%2Fsdns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/senorprogrammer","download_url":"https://codeload.github.com/senorprogrammer/sdns/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senorprogrammer%2Fsdns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32230937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["crystal","dns","macos"],"created_at":"2024-10-13T12:35:16.326Z","updated_at":"2026-04-24T16:32:36.723Z","avatar_url":"https://github.com/senorprogrammer.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cpre\u003e\n         _           \n        | |          \n ___  __| |_ __  ___ \n/ __|/ _` | '_ \\/ __|\n\\__ \\ (_| | | | \\__ \\\n|___/\\__,_|_| |_|___/\n\u003c/pre\u003e\n\nA command-line DNS switcher for macOS. \n\nYou could do:\n\n    Apple Menu -\u003e System Preferences -\u003e Network -\u003e Wi-Fi -\u003e Advanced -\u003e DNS -\u003e [+]\n    \nand then manually type in your new DNS servers like a chump. Or you could just type:\n\n    $ sdns switch google\n    \nand have it done automatically.\n\n---\n\n- [Caveats](#caveats)\n- [Installation](#installation)\n\t- [Installing for development](#installing-for-development)\n\t- [Installing the binary](#installing-the-binary)\n\t- [Uninstalling the binary](#uninstalling-the-binary)\n- [Usage](#usage)\n\t- [current](#current)\n\t- [default](#default)\n\t- [flush](#flush)\n\t- [help](#help)\n\t- [list](#list)\n\t- [switch ](#switch)\n\t- [version](#version)\n- [License](#license)\n\n## Caveats\n\n**Caveat 1:** At the moment `sdns` only works with the Wi-Fi interface.\n\n**Caveat 2:** You'll be asked to enter your user password to make any DNS settings changes. Don't be alarmed by this, it's perfectly normal.\n\n\u003cp align='center'\u003e\n  \u003cimg src='docs/auth.png' width='400' height='250' alt='auth dialog' /\u003e\n\u003c/p\u003e\n\n**Caveat 3:** If you don't have `networksetup` installed for some reason (the absence of which would be pretty freaky if you're on macOS), things will not go well for you. \n\nTo double-check: `$ which networksetup`. You should see `/usr/sbin/networksetup`.\n\n## Installation\n\nThis is a [Crystal](https://crystal-lang.org) app. Until I make a proper release, your best bet is to install Crystal via [Homebrew](https://brew.sh), download this source code, compile, and install it yourself.\n\n### Installing for development\n\nYou'd like to try it before installing it, or want to change the source:\n\n    cd ./sdns\n    `make build`, `make debug`, or `make run`\n\nCheck the Makefile for details on the differences between each.\n\n### Installing the binary\n\nYou don't care about the source or mucking about with it, you just want to use this app to switch your DNS. You just need the app installed:\n\n    cd ./sdns\n    make install\n\nThe installation process:\n\n* compiles the excutable binary\n* copies that binary to `/usr/local/bin`\n* copies a `.sdns.yaml` config file to your home directory\n\nStill less effort than clicking through the Network system pref to do things.\n\n### Uninstalling the binary\n\nSimilar process:\n\n    cd ./sdns\n    make uninstall\n\nThe uninstallation process:\n\n* removes the binary from `/usr/local/bin`\n* removed the `.sdns.yaml` file from your home directory\n\n## Usage\n\nFirst, ensure that `.sdns.yaml` is in your home directory (`$ ls -al ~ | grep sdns`). \n\nThis source comes with one configured for [Google](https://developers.google.com/speed/public-dns/), [OpenDNS](https://use.opendns.com), and [UnblockUs](https://support.unblock-us.com/customer/portal/articles/291525?_ga=1.208644567.452473323.1486340879) that will be written to that location the first time you run the app. Extend that at your leisure.\n\n`sdns` supports the following commands:\n\n### current\n\n    $ sdns current\n    \nDisplays your current DNS settings. If you have custom settings configured, it'll display those:\n\n    google:\n        8.8.8.8\n        8.8.4.4\n        \nIf you don't yet have any custom settings configured, you'll see this message:\n\n    There aren't any DNS Servers set on Wi-Fi.\n    \n### default\n\n    $ sdns default\n    \nSwitched your DNS settings back to their default settings, which is likely whatever your router or ISP provide.\n\nIn other words, it deletes your custom settings.\n\n### flush\n\n    $ sdns flush\n    \nFlushes your DNS cache (works on Sierra; may not yet work in earlier OS X releases).\n\n### help\n\n    $ sdns help\n    \nDisplays help documentation describing all the available commands.\n\n### list\n\n    $ sdns list\n    \nDisplays a table of all the possible DNS settings you cand switch to. Available out of the box are Google, OpenDNS, and UnblockUs.\n\n### switch \u003cid\u003e\n\n    $ sdns switch 1\n    \nor\n\n    $ sdns switch google\n    \nSwitches your DNS settings to the specified provider. \n\nYou can also use:\n\n    $ sdns switch empty\n    \nto delete any custom settings. This is effectively the same as `./sdns default`.\n\n### version\n\n    $ sdns --version\n    \nDisplays the current app version.\n\n## License\n\nThe project is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsenorprogrammer%2Fsdns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsenorprogrammer%2Fsdns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsenorprogrammer%2Fsdns/lists"}