{"id":15373120,"url":"https://github.com/vi/resolvconffs","last_synced_at":"2025-04-15T14:21:45.002Z","repository":{"id":57660541,"uuid":"453787510","full_name":"vi/resolvconffs","owner":"vi","description":"Special FUSE filesystem to map /etc/resolv.conf to different files depending on Linux network namespace","archived":false,"fork":false,"pushed_at":"2023-03-05T20:26:15.000Z","size":16,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-03-23T08:23:05.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/vi.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-01-30T20:00:55.000Z","updated_at":"2023-12-21T20:03:07.000Z","dependencies_parsed_at":"2024-10-01T13:54:21.943Z","dependency_job_id":"9b2dd7c4-9780-4f9a-804c-43a26faf4394","html_url":"https://github.com/vi/resolvconffs","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"2f11459e647459ba026587ce055085c72f9253df"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fresolvconffs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fresolvconffs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fresolvconffs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fresolvconffs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vi","download_url":"https://codeload.github.com/vi/resolvconffs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249085438,"owners_count":21210267,"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":[],"created_at":"2024-10-01T13:54:19.639Z","updated_at":"2025-04-15T14:21:44.965Z","avatar_url":"https://github.com/vi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# resolvconffs\n\nLinux network namespaces allow separate networking environment for a group of processes (sharing uid or from a separate user).\nDNS settings (`/etc/resolv.conf`) are however shared between all those environments, which may be inconvenient in some setups.\n\nTypically (i.e. in `ip netns` tool) the mount (filesystem) namespace is used along with netns as a workaround, mapping distinct `/etc/netns/...` files to main `/etc/resolv.conf`. This tool provides different approach based on a FUSE filesystem which provides similar mapping without using additional mount namespace.\n\nIt works by inspecing PIDs of each programs that access the mounted `/etc/resolv.conf` and using `/proc/\u003cpid\u003e/ns/net` to find out which underlying file should be used and forwarding reads and writes to that file instead. Missing files may be propagated from a user-specified template file.\n\n# Example\n\n(untested)\n\n```\n# cp /etc/resolv.conf /etc/resolv.conf.bak\n# mkdir /tmp/resolvconfs\n# /opt/resolvconffs -d /etc/resolv.conf.bak /tmp/resolvconfs /etc/resolv.conf\u0026\n```\n\n\n# Installation\n\nDownload a pre-built x64_64 version from Github releases or try `cargo install` or download source code and use `cargo build --release`. Copy resulting executable where you want.\n\nIntegrating the tool with distro's networking stack is out of scope for this document.\n\n\n# Usage output\n\n```\nresolvconffs --help\nUsage: /opt/resolvconffs [OPTIONS]\n\nSpecial FUSE filesystem that maps its sole file to other files based on network namespace of process that queries the file.\n\nPositional arguments:\n  backing_directory          Directory where to look for resolv.conf-like files for each netns.\n  mountpoint_file\n\nOptional arguments:\n  -h, --help\n  -p, --extension EXTENSION  Filename extension. resolvconffs maps its file to \u003cbacking_directory\u003e/\u003cnetns_identifier\u003e\u003cpostfix\u003e (default: conf)\n  -d, --default-file DEFAULT-FILE\n                             In case of target file does not exist, copy this file to target instead of returning ENOENT.\n  -P, --procfs PROCFS        Directory where to look up network namespace IDs based on PIDs. (default: /proc)\n  -o, --fuse-opt OTHER-FUSE-OPTS\n  ```\n\n# Library usage\n\nThe project is not libified and library usage is not intended.\n\nThere is a simple reusable component named `FileMapperFs` inside, allowing implementing similar single-file filesystems based on `fuser` crate that maps the file based on `uid`, `gid` or `pid` of accessing process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Fresolvconffs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvi%2Fresolvconffs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Fresolvconffs/lists"}