---
title: "Element <host>"
source: https://dev.pageseeder.com/api/elements/element_host.html
description: "API Element reference for <host>"
last_updated: 2026-08-07T17:09:54+10:00
tokens: ~696
---

# \<host\>

## Summary

Following is an XML representation of a host. Hosts are represented in the same manner regardless of their context.

Hosts can have aliases which are listed in the `<aliases>` element.

## Usage context

| Permitted content | `<aliases>` |
| --- | --- |
| Permitted parent | `<host-creation> <host-modification> <hosts>` |

## Attributes

This element includes the following attributes.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| external | `xs:boolean` | yes | Whether the host is external |
| id | `xs:long` | yes | The ID of the host in PageSeeder |
| name | `xs:string` | yes | The hostname ( max 100 characters) |
| virtual | `xs:boolean` | yes | Whether the host is virtual. *PageSeeder v5.99 or higher.* |

### `@external`

This boolean attribute indicates whether the domain for this host is external or matches the PageSeeder server.

### `@id`

The PageSeeder database identifier for the host. It is always an immutable positive long value that is unique on a specific PageSeeder server within the set all hosts.

### `@name`

The name of this host, which must be a valid domain name. The value is not case-sensitive. The name cannot exceed 255 characters.

For example: `app.example.org`

### `@virtual`

This boolean attribute indicates whether the domain for this host is virtual (i.e. the domain URLs do not resolve to actual resources). *Introduced in PageSeeder v5.99.*

## Examples

### Host with no aliases

```lang-xml

<host id="1" name="ps.example.com" external="false" virtual="false"/>
```

### Host aliases

```lang-xml

<host id="1" name="app.example.com" external="false" virtual="false">
  <aliases>
    <alias id="1" name="app.example.org"/>
    <alias id="2" name="app.example.net"/>
  </aliases>
</host>
```

## Schema

### XML Schema

```lang-relax

<xs:element name="host" type="host"/>

<xs:complexType name="host">
  <xs:sequence>
    <xs:element name="aliases" type="aliases" minOccurs="0"/>
  </xs:sequence>
  <xs:attribute name="external" type="boolean" use="required"/>
  <xs:attribute name="id" type="id" use="required"/>
  <xs:attribute name="name" type="hostname" use="required"/>
  <xs:attribute name="virtual" type="boolean" use="required"/>
</xs:complexType>

<xs:simpleType name="hostname">
  <xs:restriction base="xs:string">
    <xs:maxLength value="100"/>
    <xs:pattern 
value="([a-z0-9]([a-z0-9-]*[a-z0-9])?\.?)+[a-z0-9]([a-z0-9-]*[a-z0-9])?"/>
  </xs:restriction>
</xs:simpleType>
```

### Relax Schema

```lang-relax

element host {
   attribute external { xs:boolean },
   attribute id       { xs:long },
   attribute name     { text { maxLength = "100"}},
   attribute virtual  { xs:boolean },
   element aliases
}
```

## Compatibility

No change since initial API release.

