[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [getPurchasedServers](./bitburner.ns.getpurchasedservers.md)
## NS.getPurchasedServers() method
Returns an array with either the hostnames or IPs of all of the servers you have purchased.
Signature:
```typescript
getPurchasedServers(hostnameMode?: boolean): Host[];
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| hostnameMode | boolean | \] Optional. Defaults to true. Returns hostnames if true, and IPs if false. |
Returns:
[Host](./bitburner.host.md)\[\]
Returns an array with either the hostnames or IPs of all of the servers you have purchased.
## Remarks
2.25 GB