The DeNS App is a decentralized DNS application based on Ethereum, integrated with a DNS server and a client-side interface. The application is built using smart contracts written in Solidity, with Node.js and Next.js for the server and front-end, connected to Ethereum via Ethers.js. Traditional DNS features, such as domain addition, modification, deletion, and DNS lookup, are implemented in the developed application.
- Add, modify, and delete domains using smart contracts.
- Transparent and immutable records stored on the Ethereum blockchain.
- Perform DNS lookups through the decentralized system.
- Secure login via Ethereum wallet (e.g., MetaMask).
- Transaction signing for domain operations.
- Seamless compatibility with existing DNS infrastructure.
Before getting started, ensure you have the following installed:
- Node.js
- npm
- A supported wallet like MetaMask for testing blockchain interactions
- Git
git clone https://github.com/dteti-sys-rsch/dns-blockchain.git
cd dns-blockchain
- Change Directory
cd smart-contract
- Set .env Variables for Smart Contract
ETHERSCAN_API_KEY="YOUR_ETHERSCAN_API_KEY"
INFURA_API_KEY="YOUR_INFURA_API_KEY"
SEPOLIA_PRIVATE_KEY="YOUR_SEPOLIA_PRIVATE_KEY"
- Install Dependencies
npm install
- Run Hardhat Locally
npx hardhat node
- Compile Smart Contracts
npx hardhat compile
- Deploy Smart Contracts
npx hardhat run scripts/deploy.js --network localhost
- Change Directory
cd client
- Set .env variables for Next.js
NEXT_PUBLIC_CONTRACT_ADDRESS="YOUR_CONTRACT_ADDRESS"
NEXT_PUBLIC_INFURA_API_KEY="YOUR_INFURA_API_KEY"
- Install Dependencies
npm install
- Run the Next.js Application
npm start
- View the Application on Localhost (http://localhost:3000)
- Change Directory
cd server
- Set .env variables for Node.js
INFURA_API_KEY="YOUR_INFURA_API_KEY"
CONTRACT_ADDRESS="YOUR_CONTRACT_ADDRESS"
- Install Dependencies
npm install
- Run the DNS Server
node index.mjs
- Test DNS Lookup
dig @localhost <domain-name>
- smart-contract/: Smart contract files using Solidity and Hardhat
- client/: Client interface files using Next.js
- server/: DNS server files for testing using Node.js
Contributions are welcome! Please submit a pull request or open an issue to discuss proposed changes.
This project is licensed under the MIT License.