---
description: Resolve .base name with Web3 JS package
---

# Web3 JS

## Installation <a href="#installation" id="installation"></a>

```
npm i web3
```

## Setup BNS registry <a href="#init-bns-registry" id="init-bns-registry"></a>

```javascript
import { ENS } from "web3-eth-ens";

const bns = new ENS(
  "0xeCBaE6E54bAA669005b93342E5650d5886D54fc7",
  "https://mainnet.base.org"
);
```

{% hint style="info" %}
**0xeCBaE6E54bAA669005b93342E5650d5886D54fc7** is BNS Registry contract on Base mainnet.
{% endhint %}

## Resolve .base name to address <a href="#domain-resolution" id="domain-resolution"></a>

```
bns.getAddress("hello.base");
```

## Resolve address to .base name <a href="#reverse-resolution" id="reverse-resolution"></a>

{% hint style="info" %}
Web3 js does not support reverse resolution
{% endhint %}
