{"id":22394093,"url":"https://github.com/flant/nginx-http-rdns","last_synced_at":"2025-07-31T10:32:27.073Z","repository":{"id":145580014,"uuid":"5021677","full_name":"flant/nginx-http-rdns","owner":"flant","description":"Nginx HTTP rDNS module","archived":false,"fork":false,"pushed_at":"2022-02-08T05:41:39.000Z","size":33,"stargazers_count":151,"open_issues_count":17,"forks_count":31,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-06-05T15:04:21.748Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flant.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}},"created_at":"2012-07-13T16:07:46.000Z","updated_at":"2025-05-21T12:46:40.000Z","dependencies_parsed_at":"2023-04-24T12:02:43.276Z","dependency_job_id":null,"html_url":"https://github.com/flant/nginx-http-rdns","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flant/nginx-http-rdns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flant%2Fnginx-http-rdns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flant%2Fnginx-http-rdns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flant%2Fnginx-http-rdns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flant%2Fnginx-http-rdns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flant","download_url":"https://codeload.github.com/flant/nginx-http-rdns/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flant%2Fnginx-http-rdns/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268024585,"owners_count":24183149,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"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":[],"created_at":"2024-12-05T05:08:58.786Z","updated_at":"2025-07-31T10:32:26.846Z","avatar_url":"https://github.com/flant.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nginx HTTP rDNS module\n\n## Disclaimer (February, 2022)\n\nThis module hasn't been maintained by its original developers\nfor years already. However, we can see that new issues still emerge\nwith no proper reaction from us. Please, feel free to fork\nthe project and continue its development. We'll be happy to see\nits future powered by the community.\n\n## Summary\n\nThis module allows to make a reverse DNS (rDNS) lookup for incoming\nconnection and provides simple access control of incoming hostname\nby allow/deny rules (similar to HttpAccessModule allow/deny\ndirectives; regular expressions are supported). Module works with\nthe DNS server defined by the standard resolver directive.\nThis module uses nginx core resolver cache when resolving DNS lookup,\nfor a maximum of 30 seconds or DNS response TTL.\n\n## Example\n\n    location / {\n        resolver 127.0.0.1;\n\n        rdns_deny badone\\.example\\.com;\n\n        if ($http_user_agent ~* FooAgent) {\n            rdns on;\n        }\n\n        if ($rdns_hostname ~* (foo\\.example\\.com)) {\n            set $myvar foo;\n        }\n\n        #...\n    }\n\nIn the example above, nginx will make a reverse DNS request (through\nthe 127.0.0.1 DNS server) for each request having the \"FooAgent\"\nuser agent. Requests from badone.example.com will be forbidden.\nThe $rdns_hostname variable will have the rDNS request result or\n\"not found\" (in case it's not found or any error occured) for any\nrequests made by FooAgent. For other user agents, $rdns_hostname\nwill have a special value \"-\".\n\n\n## Directives\n\n### rdns\n\n* Syntax: rdns on | off | double\n* Default: -\n* Context: http, server, location, if-in-server, if-in-location\n* Phase: rewrite\n* Variables: rdns_hostname\n\nEnables/disables rDNS lookups.\n\n* on     - enable rDNS lookup in this context.\n* double - enable double DNS lookup in this context. If the reverse\n           lookup (rDNS request) succeeded, module performs a forward\n           lookup (DNS request) for its result. If this forward\n           lookup has failed or none of the forward lookup IP\n           addresses have matched the original address,\n           $rdns_hostname is set to \"not found\".\n* off    - disable rDNS lookup in this context.\n\nThe $rdns_hostname variable may have:\n\n* result of lookup;\n* special value \"not found\" if not found or error occurred during\n  request;\n* special value \"-\" if lookup disabled.\n\nAfter performing a lookup, module restarts request handling pipeline\nto make new $rdns_hostname variable value visible to other directives.\n\nNotice on server/location \"if\":\n\nInternally, in server's or location's \"if\", module works through\nrewrite module codes. When any enabling directive (rdns on|double) is\nexecuted for the first time, it enables DNS lookup and makes a break\n(to prevent executing further directives in this \"if\"). After the\nlookup is done, directives in \"if\" using rewrite module codes are\nexecuted for the second time, without any breaks. Disabling directive\n(rdns off) makes no breaks.\n\nCore module resolver should be defined to use this directive.\n\n\n### rdns_allow\n\n* Syntax: rdns_allow regex\n* Default: -\n* Context: http, server, location\n* Phase: access\n* Variables: -\n\nGrants access for domain matched by regular expression.\n\n\n### rdns_deny\n\n* Syntax: rdns_deny regex\n* Default: -\n* Context: http, server, location\n* Phase: access\n* Variables: -\n\nForbids access for domain matched by regular expression.\n\n\n## Notice on access lists\n\nThe rdns_allow and rdns_deny directives define a new access list for\nthe context in which they are used.\n\nAccess list inheritance in contexts works only if child context\ndoesn't define own rules.\n\n\n## Warning on named locations\n\nMaking rDNS requests in named locations isn't supported and may\ninvoke a loop. For example:\n\n    server {\n        rdns on;\n\n        location / {\n            echo_exec @foo;\n        }\n\n        location @foo {\n            #...\n        }\n    }\n\nBeing in a named location and restarting request handling pipeline,\nnginx continue its request handling in usual (unnamed) location.\nThat's why this example will make a loop if you don't disable the\nmodule in your named location. The correct config for this example\nshould be as follows:\n\n    server {\n        rdns on;\n\n        location / {\n            echo_exec @foo;\n        }\n\n        location @foo {\n            rdns off;\n            #...\n        }\n    }\n\n\n## Authors\n\nThe original version of this module has been designed by\nDmitry Stolyarov, written by Timofey Kirillov, [Flant](https://flant.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflant%2Fnginx-http-rdns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflant%2Fnginx-http-rdns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflant%2Fnginx-http-rdns/lists"}