[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [getServer](./bitburner.ns.getserver.md)
## NS.getServer() method
Returns a server object for the given server. Defaults to the running script's server if host is not specified.
Signature:
```typescript
getServer(host?: string): Server;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| host | string | Optional. Hostname for the requested server object. |
Returns:
[Server](./bitburner.server.md)
The requested server object.
## Remarks
RAM cost: 2 GB