> ## Documentation Index
> Fetch the complete documentation index at: https://e-gurl.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Contributing Overview

> How to contribute to DNS-MNS

# Contributing to DNS-MNS

Thank you for your interest in contributing to DNS-MNS! This project helps Iranian gamers find and configure optimal DNS servers.

## Ways to Contribute

<CardGroup cols={2}>
  <Card title="Report Bugs" icon="bug">
    Found a bug? Open an issue with details about what went wrong.
  </Card>

  <Card title="Suggest Features" icon="lightbulb">
    Have an idea? Open an issue with your feature request.
  </Card>

  <Card title="Improve Documentation" icon="book">
    Fix typos, clarify instructions, or add missing information.
  </Card>

  <Card title="Add DNS Servers" icon="server">
    Know a working DNS server? Help expand the list.
  </Card>

  <Card title="Code Contributions" icon="code">
    Fix bugs or implement new features via pull requests.
  </Card>

  <Card title="Test & Review" icon="flask">
    Test the tool on your system and review pull requests.
  </Card>
</CardGroup>

## Getting Started

### 1. Fork the Repository

Go to [gitlab.com/E-Gurl/dns-mns](https://gitlab.com/E-Gurl/dns-mns) and click **Fork**.

### 2. Clone Your Fork

```bash theme={null}
git clone https://gitlab.com/YOUR-USERNAME/dns-mns.git
cd dns-mns
```

### 3. Create a Branch

```bash theme={null}
git checkout -b feature/your-feature-name
```

Use descriptive branch names:

* `feature/add-new-dns-servers`
* `fix/macos-dns-setting`
* `docs/improve-installation`

### 4. Make Your Changes

Edit the files as needed. See the [Code Style](/contributing/code-style) guide.

### 5. Test Your Changes

Before submitting:

<Checklist>
  * Script runs without errors
  * Menu displays correctly
  * DNS testing works (if modified)
  * DNS setting works (if modified)
  * Works on your platform
</Checklist>

### 6. Commit Your Changes

```bash theme={null}
git add .
git commit -m "feat: add new DNS servers for gaming"
```

See [Commit Message Guidelines](#commit-message-guidelines) below.

### 7. Push to Your Fork

```bash theme={null}
git push origin feature/your-feature-name
```

### 8. Open a Merge Request

Go to your fork on GitLab and click **New Merge Request**.

## Commit Message Guidelines

Use clear, descriptive commit messages with these prefixes:

| Prefix      | Usage                    |
| ----------- | ------------------------ |
| `feat:`     | New feature              |
| `fix:`      | Bug fix                  |
| `docs:`     | Documentation changes    |
| `refactor:` | Code restructuring       |
| `test:`     | Adding or updating tests |
| `chore:`    | Maintenance tasks        |

**Examples:**

```
feat: add new DNS testing algorithm
fix: resolve macOS DNS setting issue
docs: update README with new instructions
refactor: improve ping test performance
```

## Pull Request Guidelines

When opening a pull request:

1. **Use a descriptive title** - Summarize the change
2. **Describe what changed** - Explain the what and why
3. **Reference issues** - Link related issues with `Fixes #123`
4. **Include testing steps** - How can reviewers test the change?

**Example PR description:**

```markdown theme={null}
## Summary
Added support for OpenSUSE Tumbleweed

## Changes
- Added detection for OpenSUSE in detect_os()
- Added DNS setting method using NetworkManager

## Testing
Tested on OpenSUSE Tumbleweed 15.5:
1. Ran dns-mns
2. Tested DNS servers
3. Applied DNS settings
4. Verified with resolvectl status

Fixes #42
```

## Development Environment

### Requirements

* Go 1.21+
* Git
* A supported OS for testing

### Running Locally

```bash theme={null}
go build -o dns-mns ./cmd/dns-mns/
./dns-mns
```

### Testing Changes

```bash theme={null}
# Test DNS ping function
ping -c 3 1.1.1.1

# Test DNS query (if dig is installed)
dig @1.1.1.1 google.com

# Build and test the Go binary
go build ./cmd/dns-mns/ && ./dns-mns
```

### Project Structure (Go)

```
cmd/dns-mns/main.go        # Entry point, menus, main loop
internal/dnslist/           # DNS list parser (embeds dns-list.conf)
internal/ping/              # ICMP ping testing
internal/dnstest/           # DNS query response time testing
internal/ui/                # Terminal UI (colors, progress bar, prompts)
internal/setter/            # DNS configuration (per-platform files)
```

<Note>
  When updating `dns-list.conf`, also copy it to `internal/dnslist/dns-list.conf` so the Go binary embeds the latest list.
</Note>

## License

By contributing, you agree that your contributions will be licensed under the [MIT License](https://gitlab.com/E-Gurl/dns-mns/blob/main/LICENSE).

## Questions?

* Open an issue for questions
* Check existing issues for answers
* Join discussions on GitLab

Thank you for helping Iranian gamers get better internet access!
