{"id":23602614,"url":"https://github.com/knotsphp/flushdns","last_synced_at":"2026-02-12T07:03:08.642Z","repository":{"id":269494487,"uuid":"907575814","full_name":"knotsphp/flushdns","owner":"knotsphp","description":"Flush DNS cache on your system","archived":false,"fork":false,"pushed_at":"2024-12-24T21:36:06.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-06T17:45:40.349Z","etag":null,"topics":["dns","flush","php"],"latest_commit_sha":null,"homepage":"https://srwiez.com/open-source","language":"PHP","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/knotsphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"SRWieZ"}},"created_at":"2024-12-23T23:00:17.000Z","updated_at":"2024-12-24T21:34:16.000Z","dependencies_parsed_at":"2024-12-24T01:28:16.613Z","dependency_job_id":"d99dda47-4ed7-4fef-9ea8-4856b35afb00","html_url":"https://github.com/knotsphp/flushdns","commit_stats":null,"previous_names":["knotsphp/flushdns"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/knotsphp/flushdns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knotsphp%2Fflushdns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knotsphp%2Fflushdns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knotsphp%2Fflushdns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knotsphp%2Fflushdns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knotsphp","download_url":"https://codeload.github.com/knotsphp/flushdns/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knotsphp%2Fflushdns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29360728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["dns","flush","php"],"created_at":"2024-12-27T12:12:04.105Z","updated_at":"2026-02-12T07:03:08.586Z","avatar_url":"https://github.com/knotsphp.png","language":"PHP","funding_links":["https://github.com/sponsors/SRWieZ"],"categories":[],"sub_categories":[],"readme":"# FlushDNS\n\n[![Latest Stable Version](https://poser.pugx.org/knotsphp/flushdns/v)](https://packagist.org/packages/knotsphp/flushdns) \n[![Total Downloads](https://poser.pugx.org/knotsphp/flushdns/downloads)](https://packagist.org/packages/knotsphp/flushdns) \n[![Latest Unstable Version](https://poser.pugx.org/knotsphp/flushdns/v/unstable)](https://packagist.org/packages/knotsphp/flushdns) \n[![License](https://poser.pugx.org/knotsphp/flushdns/license)](https://packagist.org/packages/knotsphp/flushdns) \n[![PHP Version Require](https://poser.pugx.org/knotsphp/flushdns/require/php)](https://packagist.org/packages/knotsphp/flushdns) \n[![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/knotsphp/flushdns/test.yml?label=Tests)](https://github.com/knotsphp/flushdns/actions/workflows/test.yml)\n\nFlushDNS is a PHP library to flush the DNS cache of the current machine.\n\nIt also provides a command line utility: `flushdns`.\n\nCompatible with MacOS, Linux, and Windows.\n\n## 🚀 Installation\n\n```bash\ncomposer require knotsphp/flushdns\n```\n\n## 📚 Usage\n```php\nuse KnotsPHP\\FlushDNS\\FlushDNS;\n\n// Flush DNS cache\n$success = FlushDNS::run(); \n\n// Only get the command\n$command = FlushDNS::getCommand();\n\n// Check if the command needs elevated privileges\n$needsElevation = FlushDNS::needsElevation();\n```\n\nThis library also comes some helpers fnuctions for Curl:\n\n```php\n// Get options to ignore dns cache\n$flushDnsOptions = FlushDNS::getCurlOpts();\n\n// Make the request\n$curl = curl_init();\ncurl_setopt_array($curl, array_merge(\n    [\n        CURLOPT_URL =\u003e \"https://app.unolia.com/api/v1/domains\",\n        CURLOPT_RETURNTRANSFER =\u003e true,\n        CURLOPT_HTTPHEADER =\u003e [\n            \"Accept: application/json\",\n            \"Authorization: Bearer 123\"\n        ],\n    ],\n    $flushDnsOptions,\n));\n$response = curl_exec($curl);\n$domains = json_decode($response);\ncurl_close($curl);\n```\n\n## 📚 Use in command line\n\nYou can also use this library in the command line by using the `flushdns` command.\n\nIt's recommended to install the library globally to use it in the command line.\n```bash\ncomposer global require knotsphp/flushdns\n```\n\nThen you can use the `flushdns` command to get the public IP address of the current machine.\n```bash\n# In your project directory\nvendor/bin/flushdns\n\n# Globally installed\nflushdns\n```\n\n## 📖 Documentation\nThis library is compatible with MacOS, Linux, and Windows.\n\nSome operating systems may require root access to flush the DNS cache.\n\n## 📋 TODO\n- [ ] Add argument to public static method to get a command for a specific OS. (needs knotsphp/system updated)\n- [ ] Add support for more operating systems.\n- [ ] Add support for running elevated commands on MacOS and Linux by passing the password as an argument or having a gui prompt depending of the context. (needs knotsphp/elevated to be written)\n\n## 🤝 Contributing\nClone the project and run `composer update` to install the dependencies.\n\nBefore pushing your changes, run `composer qa`. \n\nThis will run [pint](http://github.com/laravel/pint) (code style), [phpstan](http://github.com/phpstan/phpstan) (static analysis), and [pest](http://github.com/pestphp/pest) (tests).\n\n## 👥 Credits\n\nFlushDNS was created by Eser DENIZ.\n\n## 📝 License\n\nFlushDNS is licensed under the MIT License. See LICENSE for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknotsphp%2Fflushdns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknotsphp%2Fflushdns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknotsphp%2Fflushdns/lists"}