# llGetSimulatorHostname

*LSL function*

```lsl
string string llGetSimulatorHostname();
```

- Returns: `string`
- Delay: 10 s
- Energy: 10

Returns a string containing the hostname of the server machine running the script (e.g., 'sim225.agni.lindenlab.com').

Returns a [string](https://wiki.secondlife.com/wiki/string) that is the hostname of the machine the script is running on (same as string in viewer Help dialog)

```lsl title="How to use" frame="terminal"
string result = llGetSimulatorHostname();
```

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={1-13, 19-26}
// The beginnings of a region-info script.
string region;
string sim;

default
{
    state_entry()
    {
        llSetTimerEvent(1.0);
    }
    timer()
    {
        string here = llGetRegionName();
        if(region != here)
        {
            sim = llGetSimulatorHostname();
            region = here;
        }
        llSetText(
                "   REGION NAME : " + region +
              "\n  SIM HOSTNAME : " + sim +
              "\nTIME DIALATION : " + (string)llGetRegionTimeDilation() +
              "\n    REGION FPS : " + (string)llGetRegionFPS(),
            <0,1,0>, 1.0);
    }
}
```

</details>

<details>
<summary>Example 2</summary>

```lsl
// llGetEnv now offers an equivalent function without the 10 second delay.
SaySimulatorHostname()
{
    llOwnerSay("Simulator Hostname: " + llGetEnv("simulator_hostname") );
}

default
{
    on_rez(integer start_param)
    {
        SaySimulatorHostname();
    }

    changed(integer iChange)
    {
        if (iChange & (CHANGED_REGION_START|CHANGED_REGION))
            SaySimulatorHostname();
    }

    state_entry()
    {
        SaySimulatorHostname();
    }
}
```

</details>

## See also

### Functions

- [llGetRegionFPS](/functions/llGetRegionFPS/) — Gets the region FPS
- [llGetRegionTimeDilation](/functions/llGetRegionTimeDilation/) — Gets the region time dilation
- [llGetEnv](/functions/llGetEnv/)("simulator_hostname") — Equivalent function without the script delay

### Articles

- [Simulator IP Addresses](https://wiki.secondlife.com/wiki/Simulator_IP_Addresses)

---

*Source: [LlGetSimulatorHostname](https://wiki.secondlife.com/wiki/LlGetSimulatorHostname) on the Second Life Wiki. Content from the Second Life Wiki article LlGetSimulatorHostname (revision 1196544, 2015-05-17), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llGetSimulatorHostname/
