<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [dnsLookup](./bitburner.ns.dnslookup.md)

## NS.dnsLookup() method

Given a hostname, returns its IP address; or given an IP address, returns its hostname.

**Signature:**

```typescript
dnsLookup(host?: string): string;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

host


</td><td>

string


</td><td>

_(Optional)_ Hostname/IP of the target server. Optional. Defaults to current server if not provided.


</td></tr>
</tbody></table>

**Returns:**

string

## Remarks

RAM cost: 0.05 GB

