Tip of the day: The Security article gives hands-on tips on how to deal with drone attacks, flooding, spammers, (D)DoS and more. |
Vhost block
The vhost block allows you to configure "virtual hosts" so users can obtain a fake hostname.
There are two ways to get a vhost from the vhost block:
- Users can login via
VHOST login password
- Vhosts can be applied automatically if auto-login is set to yes. (This requires UnrealIRCd 6.1.8 or later)
NOTE: Often, people don't use vhost blocks but use Services instead with a HostServ bot or capability. These allow you to centrally manage vhosts.
Syntax
vhost { /* Optionally set this to 'yes' */ auto-login <yes|no>; /* Always required: */ mask { ... }; /* Only if auto-login is 'no': */ login <login-name>; password <password>; /* Upon succesful login, set these: */ vhost <vhost>; swhois "<swhois info>"; /* optional */ };
When auto-login is set to yes the vhost block will be tried when the user connects to IRC, the default is no. (This requires UnrealIRCd 6.1.8 or later)
The mask is a Mask item and decides who may use this vhost block, or if auto-login is enabled: who will receive this vhost automatically.
When auto-login is off, you configure a login and password that the user needs to use with VHOST login password
. The password is a password or other authentication type.
The vhost decides what host the user will receive. This can be a hostname like this.is.my.nice.vhost
or a user@host if you also want to give a fake username/ident like [email protected]
. Standard variables are supported here, so you can use: $account.users.example.net
, see also Automatic vhost for regisistered users below.
The swhois is optional (rarely used) and can be used to add extra lines in WHOIS
.
Vhost blocks are read top-down, so the way they appear in the configuration file. For auto-login the first matching vhost block wins.
Examples
Manual vhost
vhost { mask { *.isp.com; } login mynick; password mypassword; vhost my.own.personal.vhost.com; swhois "Im Special"; }
Automatic vhost for regisistered users
In UnrealIRCd 6.1.8 and later you can give all users who used SASL to identify to Services a vhost, like this:
vhost { auto-login yes; mask { identified yes; } vhost $account.users.example.net; }
Note that if users log into Services later, through NS IDENTIFY
or similar, then their vhost will not be activated. This because vhost auto-login blocks are only executed on-connect.
Automatic vhost for someone with certfp
Requires UnrealIRCd 6.1.8 or later
Set a vhost automatically based on Certificate fingerprint.
vhost { auto-login yes; mask { certfp "e74d46f19ff468f5e8e349cc285df96585ba4f16b64902e334e6e76afe76a798"; } vhost this.user.rocks; }
If you have multiple vhost blocks with auto-login, then make sure you put this one at the beginning, before the more generic blocks.