Skip to content

[Feature] : Refactor DNS Configuration into a Dedicated Utility Module #104

Description

@jikrana1

Description

📌 Overview

The DNS configuration is currently initialized directly in the application's server bootstrap file using dns.setServers(). While this works correctly, keeping infrastructure configuration inside the server entry point makes the file less organized and harder to maintain.

The DNS initialization should be extracted into a dedicated utility module responsible for configuring custom DNS servers.

This refactoring should preserve the existing behavior and should not introduce any functional changes.


✅ Tasks

  • Create a dedicated DNS configuration utility (e.g. utils/dnsConfig.js).
  • Move the existing dns.setServers() logic into the new utility.
  • Export a function that initializes the DNS configuration.
  • Import and invoke the function during application startup.
  • Preserve the existing DNS server configuration.
  • Ensure there are no behavioral changes after the refactor.

🎯 Expected Outcome

  • Cleaner server bootstrap file.
  • DNS configuration is centralized in a dedicated utility.
  • Infrastructure-related configuration is separated from application startup logic.
  • Easier to modify or extend DNS settings in the future.

📂 Suggested Project Structure

src/
├── utils/
│   └── dnsConfig.js
├── app.js
└── server.js

✅ Acceptance Criteria

  • A dedicated DNS configuration utility has been created.
  • DNS initialization has been moved out of the server file.
  • The server imports and invokes the DNS configuration utility.
  • Existing DNS server configuration remains unchanged.
  • No application functionality is affected.
  • No existing tests fail after the refactor.

📝 Notes

This is a refactoring task intended to improve project organization and maintainability. The DNS configuration should behave exactly as before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions