Hubbry Logo
IRCdIRCdMain
Open search
IRCd
Community hub
IRCd
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
IRCd
IRCd
from Wikipedia

An IRCd, short for Internet Relay Chat daemon, is server software that implements the IRC protocol, enabling people to talk to each other via the Internet (exchanging textual messages in real time).[1][2] It is distinct from an IRC bot that connects outbound to an IRC channel.

The server listens to connections from IRC clients[3] on a set of TCP ports.[4] When the server is part of an IRC network, it also keeps one or more established connections to other servers/daemons.[5]

The term ircd originally referred to only one single piece of software,[6] but it eventually became a generic reference to any implementation of an IRC daemon.[7][8] However, the original version is still distributed under the same name,[9] and this article discusses both uses.

History

[edit]

The original IRCd was known as 'ircd', and was authored by Jarkko Oikarinen (WiZ on IRC) in 1988.[10][11] He received help from a number of others, such as Markku Savela (msa on IRC), who helped with the 2.2+msa release, etc.

In its first revisions, IRC did not have many features that are taken for granted today, such as named channels and channel operators. Channels were numbered – channel 4 and channel 57, for example – and the channel topic described the kind of conversation that took place in the channel. One holdover of this is that joining channel 0 causes a client to leave all the channels it is presently on: "CHANNEL 0" being the original command to leave the current channel.

The first major change to IRC, in version 2.5, was to add named channels – "+channels". "+channels" were later replaced with "#channels" in version 2.7, numeric channels were removed entirely and channel bans (mode +b) were implemented.

Around version 2.7, there was a small but notable dispute[clarification needed], which led to ircu – the Undernet fork of ircd.

irc2.8 added "&channels" (those that exist only on the current server, rather than the entire network) and "!channels" (those that are theoretically safe from suffering from the many ways that a user could exploit a channel by "riding a netsplit"), and is the baseline release from which nearly all current implementations are derived.

Around 2.8 came the concept of nick and channel delay, a system designed to help curb abusive practices such as takeovers and split riding. This was not agreed on by the majority of modern IRC (EFnet, DALnet, Undernet, etc.) – and thus, 2.8 was forked into a number of different daemons using an opposing theory known as TS – or time stamping, which stored a unique time stamp with each channel or nickname on the network to decide which was the 'correct' one to keep.

Time stamping itself has been revised several times to fix various issues in its design. The latest versions of such protocols are:

  • the TS6 protocol, which is used by EFnet, and Hybrid and Ratbox based servers amongst others
  • the P10 protocol, which is used by Undernet and ircu based servers.

While the client-to-server protocols are at least functionally similar, server-to-server protocols differ widely (TS5, P10, and ND/CD server protocols are incompatible), making it very difficult to "link" two separate implementations of the IRC server. Some "bridge" servers do exist, to allow linking of, for example, 2.10 servers to TS5 servers, but these are often accompanied with restrictions of which parts of each protocol may be used, and are not widely deployed.

Significant releases based on 2.8 included:

  • 2.8.21+CS, developed by Chris Behrens (Comstud)
  • 2.8+th, Taner Halicioglu's patchset, which later became
    • Hybrid IRCd, originally developed by Jon Lusky (Rodder) and Diane Bruce (Dianora) as 2.8/hybrid, later joined by a large development team.
  • 2.9, 2.10, 2.11, ... continue the development of the original codebase,

The original code base continued to be developed mainly for use on the IRCnet network. New server-to-server protocols were introduced in version 2.10, released in 1998, and in 2.11, first released in 2004, and current as of 2007. This daemon is used by IRCnet and it can be found at http://www.irc.org/ftp/irc/server/ The original ircd is free software, licensed under the GNU General Public License. This development line produced the 4 IRC RFCs released after RFC 1459, which document this server protocol exclusively.

2.8.21+CS and Hybrid IRCd continue to be used on EFnet, with ircd-ratbox (an offshoot of ircd-hybrid) as of 2004 being the most popular.

Sidestream versions

[edit]
Diagram of derivations and relations for common IRCd implementations.

More recently, several irc daemons were written from scratch, such as ithildin,[12] InspIRCd,[13] csircd (also written by Chris Behrens), ConferenceRoom,[14] Microsoft Exchange Chat Service, WeIRCd,[15] or IRCPlus/IRCXPro.[16]

These attempts have met with mixed success, and large doses of skepticism from the existing IRC development community. With each new IRCd, a slightly different version of the IRC protocol is used,[17][18] and many IRC clients and bots are forced to compromise on features or vary their implementation based on the server to which they are connected.[19] These are often implemented for the purpose of improving usability, security, separation of powers, or ease of integration with services. Possibly one of the most common and visible differences is the inclusion or exclusion of the half-op channel operator status (which is not a requirement of the RFCs).

Features

[edit]

Ports

[edit]

The officially assigned port numbers are 194 ("irc"), 529 ("irc-serv"), and 994 ("ircs").[20] However, these ports are in the privileged range (0–1024), which on a Unix-like system means that the daemon would historically have to have superuser privileges in order to open them. For various security reasons this used to be undesirable.

The common ports for an IRCd process are 6665 to 6669, with 6667 being the historical default.[21] These ports can be opened by a non-superuser process, and they became widely used.

Connections

[edit]

Running a large IRC server, one that has more than a few thousand simultaneous users, requires keeping a very large number of TCP connections open for long periods. Very few ircds are multithreaded as nearly every action needs to access (at least read and possibly modify) the global state.

The result is that the best platforms for ircds are those that offer efficient mechanisms for handling huge numbers of connections in a single thread. Linux offers this ability in the form of epoll, in kernel series newer than 2.4.x. FreeBSD (since 4.1) and OpenBSD (since 2.9) offers kqueue. Solaris has had /dev/poll since version 7, and from version 10 onwards has IOCP (I/O Completion Ports). Windows has supported IOCP since Windows NT 3.5. The difference made by these new interfaces can be dramatic. IRCU developers have mentioned increases in the practical capacity per server from 10,000 users to 20,000 users.[citation needed]

TLS (Transport Layer Security)

[edit]

Some IRCd support Transport Layer Security, or TLS, for those who don't, it is still possible to use SSL via Stunnel. The unofficial, but most often used port for TLS IRCd connections is 6697. More recently, as a security enhancement and usability enhancement, various client and server authors have begun drafting a standard known as the STARTTLS standard[22] which allows for TLS and plain text connections to co-exist on the same TCP port.

IPv4 and IPv6

[edit]

IRC daemons support IPv4, and some also support IPv6. In general, the difference between IPv6 and IPv4 connections to IRC is purely academic and the service operates in much the same manner through either protocol.

Clustering

[edit]

Large IRC networks consist of multiple servers for horizontal scaling purposes. There are several IRC protocol extensions for these purposes.[23]

IRCX

[edit]

IRCX (Internet Relay Chat eXtensions) is an extension to the IRC protocol developed by Microsoft

P10

[edit]

The P10 protocol is an extension to the Internet Relay Chat protocol for server to server communications developed by the Undernet Coder Committee to use in their ircu server software. It is similar in purpose to IRCX and EFnet TS5/TS6 protocols and implements nick and channel timestamping for handling nick collisions and netsplit channel riding, respectively. Other IRCd's that utilize this protocol extension include beware ircd.[23][24][25]

TS6

[edit]

The TS6 protocol is an extension to the Internet Relay Chat protocol for server to server communications developed initially by the developers of ircd-ratbox. It has been extended by various IRC software and has the feature that proper implementations of TS6 can link to each other by using feature negotiation—even if features are disparate.

Configuration

[edit]

Jupe

[edit]

Juping a server, a channel, or a nickname refers to the practice of blocking said channel or nickname on the server or network or said server on the network. One possible explanation of how this term came about is that it is named after the oper named Jupiter, who gained control of the nickname NickServ on EFnet.[26][citation needed] EFnet does not offer services such as NickServ; Jupiter gained control of the nickname as he (among other operators) did not believe nicknames should be owned. Today, EFnet opers jupe nicknames that are used as services on other networks.

A nickname or server jupe takes advantage of the fact that certain identifiers are unique; by using an identifier, one acquires an exclusive lock that prevents other users from making use of it.

Officially sanctioned jupes may also utilize services or server configuration options to enforce the jupe, such as when a compromised server is juped to prevent it from harming the network.

In practice IRC operators now use jupe configurations to administratively make channel or nicknames unavailable.[27] A channel jupe refers to a server specific ban of a channel, which means that a specific channel cannot be joined when connected to a certain server, but other servers may allow a user to join the channel. This is a way of banning access to problematic channels.

O-line

[edit]

An O-line (frequently also spelled as O:line[citation needed]; on IRCds that support local operators, the O-lines of those are called o:lines with a lower-case O[citation needed]), shortened from Operator Line and derived from the line-based configuration file of the original IRCd, is a line of code in an IRC daemon configuration file that determines which users can become an IRC operator and which permissions they get upon doing so. The name comes from the prefix used for the line in the original IRCd, a capital O. The O-line specifies the username, password, operator flags, and hostmask restrictions for a particular operator. A server may have many O-lines depending on the administrative needs of the server and network.[28]

Operator flags are used to describe the permissions an operator is granted. While some IRC operators may be in charge of network routing, others may be in charge of network abuse, making their need for certain permissions different.[4] Operator flags available vary widely depending on which IRC daemon is in use. Generally, more feature rich IRC daemons tend to have more operator flags, and more traditional IRC daemons have fewer.

An O-line may also be set so that only users of a certain hostmask or IP address can gain IRC operator status using that O-line. Using hostmasks and IP addresses in the O-line requires the IP address to remain the same but provides additional security.

K-line

[edit]

When a user is k-lined (short for kill line), the user is banned from a certain server, either for a certain amount of time or permanently. Once the user is banned, they are not allowed back onto that server. This is recorded as a line in the server's IRC daemon configuration file prefixed with the letter "K", hence "K-line".

Some IRC daemons, including ircd-hybrid and its descendants, can be configured to propagate K-lines to some or all other servers on a network. In such a configuration, K-lines are effectively global bans similar to G-lines.

While the precise reason for the disconnection varies from case to case, usual reasons involve some aspect of the client or the user it is issued against.

User behavior
K-lines can be given due to inappropriate behavior on the part of the user, such as "nickname colliding", mode "hacking", multiple channel flooding, harassing other users via private messaging features, "spamming" etc., or in the case of older networks without timestamping, split riding, which cannot be corrected through use of channel operator privileges alone.
Client software
Some IRC daemons can be configured to scan for viruses or other vulnerabilities in clients connecting to them, and will react in various ways according to the result. Outdated and insecure client software might be blocked to protect other network users from vulnerabilities, for instance. Some networks will disconnect clients operating on/via open proxies, or running an insecure web server.
Geographic location
An IRC network operating multiple servers in different locales will attempt to reduce the distance between a client and a server. This is often achieved by disconnecting (and/or banning) clients from distant locales in favour of local ones.

There are a number of other network "lines" relating to the K-line. Modern IRC daemons will also allow IRC operators to set these lines during normal operation, where access to the server configuration file is not routinely needed.

G-line

[edit]

A G-line or global kill line (also written G:line) is a global network ban applied to a user; the term comes from Undernet but on DALnet a similar concept known as an AKill was used.[citation needed]

G-lines are sometimes stored in the configuration file of the IRCd, although some networks, who handle K-lines through the IRC services, prefer to have them stored in their service's configuration files. Whenever a G-lined person attempts to connect to the IRC network, either the services or the IRC daemon will automatically disconnect the client, often displaying a message explaining the reasoning behind the ban.

G-lines are a variant of K-lines, which work in much the same way, except K-lines only disconnect clients on one server of the network. G-lines are normally applied to a user who has received a K-line on one server but continues to abuse the network by connecting via a different server. G-lines are often regarded as an extreme measure, only to be used in cases of repeated abuse when extensive attempts have been made to reason with the offending user. Therefore, especially on larger networks, often only very high ranking global IRC operators are permitted to set them, while K-lines, which are mostly regarded as a local affair, are left to the operators of the individual server in the network.

G-lines also work slightly differently from K-lines. G-lines are typically set as *@IPaddress or *@host, with the first being the better option. If the *@host option is used, the server must conduct a reverse DNS lookup on the user and then compare the returned host to the hosts in the G-line list. This results in delay, and, if the DNS doesn't return correct results, the banned user may still get on the network.

Z-line

[edit]

A Z-line or zap line (also written Z:line) is similar to a K-line, but applied to a client's IP address range, and is considered to be used in extreme cases. Because a Z-line does not have to check usernames (identd) or resolved hostnames, it can be applied to a user before they send any data at all upon connection. Therefore, a Z-line is more efficient and uses fewer resources than a K-line or G-line when banning large numbers of users.

In some IRC daemons such as ircd-hybrid, this is called a D-line (deny line) or an X-line.

Z-lines are sometimes stored in the configuration file of the IRCd, although some networks, who handle lines through the IRC services, prefer to have them stored in their service's configuration files. Whenever a Z-lined person attempts to connect to the IRC network, either the services or the IRC daemon will automatically disconnect the client, often displaying a message explaining the reasoning behind the ban.

Z-lines are a variant of K-lines, which work in much the same way. Most Z-lines are "awarded" to people who abuse the network as a whole (on smaller networks, these are more frequently issued for isolated incidents).

Z-lines also work slightly differently from K-lines. Z-lines are typically set as *@IP or *@host, with the first being the better option. Z-lines do not wait for an ident response from the connecting user, but immediately close the socket once the user's IP is compared to the Z-line list and a match is found. If the *@host option is used, the server must conduct a reverse DNS lookup on the user and then compare the returned host to the hosts in the Z-line list. This can result in delays, or if the DNS doesn't return correctly, banned users could still get on the network. In actuality, the *@host option is completely against the intentions of using a Z-line, and therefore some IRCd programs will not allow anything other than *@IP, with wildcards (?,*) or CIDR prefix lengths (e.g. /8) allowed in the IP section to block entire subnets. Another difference from K-lines (which affect only IRC clients) is if an IP is banned, nothing, not even other servers, can connect from this IP (or IP range, depending on the banmask).

One advantage to using Z-lines over K-lines and G-lines, from a server or network administrator's perspective, a Z-line uses less bandwidth than a K-line, mainly because it doesn't wait for an ident response or DNS lookup.

A disadvantage to using Z-line over K-line or G-line is that it becomes more difficult to ban entire ISPs and very dynamic IP addresses, common with some dialup and DSL connections. For example, if a network administrator wants to ban all of ISP example.com (with hypothetical IP address ranges of 68.0.0.0 – 68.255.255.255 and 37.0.0.0 – 38.255.255.255), a G-line could use *@*example.com, whereas Z-line would require *@37.*.*.*, *@38.*.*.*, and *@68.*.*.* to accomplish the same thing.

Z-lines can also be global, in which case they are called GZ-lines. GZ-lines work in the same manner as Z-lines, except that they propagate to every server on the network. Some IRC daemons may also be configured to share Z-lines with other servers.

Q-line

[edit]

On some IRCds, such as UnrealIRCd, a Q-line forbids a nickname, or any nickname matching a given pattern. This is most often used to forbid use of services nicknames (such as "X", or NickServ) or forbid use of IRC operator nicknames by non-operators. Some IRC daemons may disconnect users when initially applying the Q-line, whilst others will force a nickname change, or do nothing until the user covered by the Q-line reconnects. Other IRCds, like ircd-hybrid, use the "RESV" ("reserve") command instead, with the stats letter remaining as Q. The "RESV" command can also forbid a channel from being used.

See also

[edit]

References

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
IRCd, short for Internet Relay Chat daemon, is server software that implements the IRC protocol to facilitate real-time, text-based communication among users over the , typically organized into channels for group discussions or direct messages, with servers linking to form expansive networks. The protocol operates on a client-server model using TCP/IP, where servers handle message , user , and network maintenance while ensuring a structure to avoid loops and maintain connectivity. Development of IRCd began in August 1988 when , known as WiZ, wrote the initial IRC client and server software at the in as a replacement for the MUT talk program on the local BBS, inspired by the BITNET Relay system. The first server, named tolsun.oulu.fi, quickly expanded across Finnish academic networks and reached the broader Internet by late 1988, growing to about 40 servers worldwide by mid-1989. In May 1993, the IRC protocol was formalized in RFC 1459 by Oikarinen and Darren Reed, defining core commands, numeric replies, and server-to-server linking mechanisms, with the reference implementation being ircd version 2.8. As IRC networks proliferated, specialized IRCd forks emerged to address scalability, security, and feature needs of major communities; for instance, ircd-hybrid originated in from EFnet's codebase to improve stability and synchronization via timestamps. Modern implementations include , a scalable IRCv3-compliant daemon forked from (based on ircd-ratbox) and used on community networks, emphasizing high performance for large user bases. Another prominent example is InspIRCd, a modular C++-based IRCd developed from scratch for cross-platform use on , BSD, Windows, and macOS, supporting extensions like IRCv3 capabilities for enhanced client features such as message tags and account registration. These evolutions have sustained IRC's relevance, with the largest networks peaking at over 200,000 simultaneous users in the mid-2000s (e.g., QuakeNet in 2005), and as of 2025, top networks collectively serving around 200,000-300,000 users daily across diverse communities, with IRCv3 extensions improving compatibility with modern clients.

Overview

Definition and Purpose

IRCd, short for Internet Relay Chat daemon, is server software that implements the IRC protocol to facilitate multi-user, real-time text-based communication over the . It serves as the core component on the server side, handling connections from IRC clients and managing the exchange of messages among users. The origins of IRC and its associated server software trace back to August 1988, when Finnish programmer developed the initial IRC client and server at the to replace earlier talk-like systems, such as MUT (MultiUser talk), used on Finnish university networks like the OuluBox . This creation addressed the need for more robust, multi-user discussion forums inspired by systems like Bitnet Relay Chat, marking the birth of a protocol designed for distributed, real-time interaction. The primary purpose of IRCd is to enable the formation of distributed networks of interconnected servers that relay messages between clients, supporting features such as channels for group discussions, private messaging for one-on-one conversations, and operator privileges for network administration. In this setup, IRCd operates within a client-server model where clients—user applications like or —connect to an IRCd instance for communication, while the daemon manages server-to-server links to propagate messages across the broader network without clients needing direct peer connections. This architecture allows for scalable, fault-tolerant chatting environments that can span multiple physical servers.

Core Architecture

The core architecture of IRCd revolves around an event-driven model that enables efficient handling of real-time communications across a distributed network of servers. Servers operate as the central nodes, forming a spanning tree topology to connect clients and propagate messages without direct client-to-client interactions. This design ensures scalability and reliability, with each server managing local and global states while relaying information along the shortest paths in the tree. The architecture emphasizes modularity, separating concerns such as input parsing, connection management, and state tracking to allow for extensibility and maintenance. A key component is the , which includes a dedicated parser for processing IRC commands from incoming connections. The parser interprets messages in a structured format—consisting of a prefix (source), command name, parameters, and a trailing parameter if needed—ending with a and line feed (CR-LF). Commands like PRIVMSG for private messages or JOIN for channel entry are tokenized and validated against the IRC protocol specifications. Complementing this is an that orchestrates operations, monitoring file descriptors for client and server sockets to handle multiple concurrent connections without blocking. This event-driven nature, often implemented using select() or mechanisms in systems, allows IRCd to respond promptly to events such as new connections, data arrivals, or timeouts. Message propagation is central to IRCd's operation, where servers relay commands across the network to maintain synchronized communication. For instance, a PRIVMSG command is forwarded from the originating server to the target user or channel via the , ensuring delivery only to relevant recipients while suppressing loops through server-specific tracking. Similarly, a JOIN command triggers propagation to update channel memberships network-wide, accompanied by numeric replies such as 001 RPL_WELCOME to confirm successful registration and greet the client with server information. These numeric replies, standardized as three-digit codes followed by descriptive text, provide feedback on command outcomes and are generated by the server in response to parsed inputs. This relay mechanism relies on server-to-server protocols to encapsulate and route messages efficiently. State management in IRCd involves maintaining comprehensive records of network entities in an in-memory database-like structure for rapid access and updates. Servers track user details (e.g., nicknames, hostmasks, modes), channel properties (e.g., topics, participant lists), bans (e.g., +b masks to exclude users), and modes (e.g., +i for invite-only channels) across the linked servers to enforce consistent rules. This global state is synchronized during server links and bursts, where initial data dumps ensure all nodes have a complete view upon connection. For persistence, some implementations store channel states—such as modes and bans—in flat files or databases to survive restarts, preventing loss of semi-permanent configurations like persistent channels. This approach balances performance with durability, using case-insensitive folding for keys like nicknames to handle variations reliably.

History

Origins and Early Development

Internet Relay Chat daemon (IRCd) originated in August 1988 when , a student at the in , developed the initial server and client software to enable real-time multi-user communication. This creation came as a replacement for the existing MultiUser Talk (MUT) program on the OuluBox (BBS), which had proven unreliable for group discussions, and drew inspiration from Bitnet Chat, a similar system operating over the Bitnet network. Unlike its predecessor, IRCd utilized TCP/IP for reliable, internet-wide connectivity, allowing servers to link and relay messages between users across different locations. The first server, named tolsun.oulu.fi, went online toward the end of that month, marking the practical inception of the IRC protocol. The early implementation focused on a straightforward client-server using a simple text-based protocol for exchange, without mechanisms like timestamps for synchronizing channel states across servers. Oikarinen quickly iterated on the software, incorporating core features such as channels—denoted by the # prefix for group conversations—and basic operator commands for network administration, which were introduced in early versions around . These elements enabled dynamic, topic-based discussions and , distinguishing IRCd from earlier chat systems limited to one-on-one or fixed-group interactions. By late , the software had evolved sufficiently for broader sharing, with early versions facilitating experimentation and refinement. Adoption accelerated in 1989 and 1990 as IRCd spread from Finnish academic institutions to other European universities via networks like FUNET and NORDUNET, and then to North American sites including MIT, the University of Denver, and Oregon State University. This expansion was driven by word-of-mouth among researchers and students seeking efficient collaboration tools over the nascent internet. By mid-1990, the network comprised around 38 servers supporting an average of 12 concurrent users, demonstrating scalable growth. The formation of EFnet in August 1990, following a split from an earlier configuration over server linking disputes, solidified it as the first major IRC network, hosting the bulk of early users and servers while preserving the original protocol's simplicity.

Forks and Major Variants

The development of IRCd has been marked by numerous forks and variants, driven primarily by efforts to address network instability, enhance features, and resolve governance disputes. In the early , frequent net splits—temporary disconnections between servers—and O-line wars, which involved contentious battles over operator privileges, plagued the original network, prompting the creation of the in October 1992 as a from EFnet's ircd 2.8.10 codebase. introduced timestamps to maintain consistent channel states across splits, reducing conflicts and improving stability, which became a foundational innovation for subsequent implementations. Building on these challenges, emerged in July 1994 as another alternative, initially based on Undernet's IRCd but developed to escape 's persistent netsplits, lag, and takeovers by prioritizing user-friendly services like NickServ and ChanServ for nickname and channel registration. later transitioned to a modified IRCd in 1999 to support its growing user base, emphasizing enhanced services integration that set it apart from earlier networks. Similarly, IRCnet formed in July 1996 as a conservative European fork of , stemming from operator disagreements over protocol changes like timestamp adoption versus traditional nick/channel delays, aiming for a more stable and decentralized structure. Modern IRCd variants have further diversified the ecosystem, often forking to incorporate advanced features, modularity, or modern protocol support amid ongoing network politics and incompatibilities. UnrealIRCd, released in 1999, evolved as a feature-rich implementation with modules for anti-flooding and spam filtering, achieving widespread adoption due to its flexibility and configuration options. ngIRCd, developed from scratch starting in 2001, focuses on lightweight operation for small or private networks, avoiding the bloat of traditional codebases while adhering to IRC standards. InspIRCd, launched in 2004, emphasizes modularity through a minimal core and extensible modules, enabling high performance and customization for diverse deployments. , originating in 2005 and based on the TS6 protocol, was designed for large-scale networks with features like SASL authentication. It influenced forks such as in 2020, developed as a collaboration between and OFTC staff after Charybdis was archived; Solanum added IRCv3.2 support and improved scalability, and gained prominence with the 2021 formation of following the freenode takeover. Ergo IRCd, introduced in 2018 as a Go-based modern server (formerly Oragono), prioritizes IRCv3 compliance for enhanced client capabilities like labeled responses, serving as a amid post-2020 efforts to revitalize IRC with contemporary standards. These variants highlight how forks have sustained IRCd's evolution, balancing innovation with the original protocol's simplicity.

Networking Features

Ports and Connections

IRCd primarily utilizes TCP as the transport protocol for all client and server connections, establishing reliable, ordered delivery of messages over the internet. The default port for plaintext client connections is 6667, a de facto standard adopted by most implementations to avoid requiring root privileges for binding to lower-numbered ports, despite the Internet Assigned Numbers Authority (IANA) originally assigning port 194 for IRC in the early 1990s. Alternative ports such as 6668 and 6669 are commonly used for additional client access points or to segregate traffic, while port 7000 is conventionally reserved for server-to-server linking to facilitate network clustering without interfering with client ports. These port assignments have remained consistent since the protocol's standardization in RFC 1459, with IANA later recognizing the range 6665-6669 for IRC-related services under the "ircu" designation. The connection establishment process begins with a standard TCP three-way handshake to form a socket between the client and server. Upon successful connection, the client must register by sending a NICK command to assign a unique , followed by a USER command providing username, modes, and real name details; the server responds with a welcome message (numeric 001) once registration completes, marking the client as operational. To maintain connection liveness and detect failures, servers periodically send PING messages, which clients must acknowledge with responses; unacknowledged PINGs result in connection termination after a configurable timeout, typically 5 minutes, preventing stale sessions from consuming resources. To mitigate denial-of-service attacks and floods, IRCd implementations employ configurable connection classes that impose limits on concurrent connections from specific IP addresses or hostnames. These classes categorize incoming connections based on criteria like IP masks or host patterns, applying throttling such as maximum connections per IP (e.g., 5-10) or time-based reconnection delays to curb abuse while allowing legitimate users. For instance, in popular daemons like InspIRCd and UnrealIRCd, administrators define classes in configuration files to balance and . In modern deployments, some IRCd servers listen on port 443 for TLS-encrypted connections to evade restrictive firewalls that block non-HTTP traffic, leveraging the ubiquity of HTTPS to improve client reachability without compromising the underlying plaintext port conventions.

TLS and Encryption

TLS support in IRCd implementations emerged in the early 2000s to secure client-server and server-server connections against eavesdropping and man-in-the-middle attacks. Early adoption relied on libraries like OpenSSL for encryption, with UnrealIRCd introducing SSL/TLS capabilities as far back as 2000. Similarly, InspIRCd integrated GnuTLS support around 2006 to enable TLS-encrypted connections without dependency on OpenSSL. These libraries handle the underlying cryptographic protocols, allowing IRCds to encrypt traffic using standards such as TLS 1.2 and later versions. A key feature for is the STARTTLS command, defined in the IRCv3 specification, which permits clients to upgrade an existing connection to TLS before registration. This command is supported in modern IRCds like UnrealIRCd and InspIRCd, where clients request the "tls" capability during capability negotiation, enabling seamless transitions to secure sessions. Configuration of TLS in IRCd typically involves specifying certificate and private key files, often in PEM format, along with cipher suite preferences to balance security and compatibility. For instance, UnrealIRCd uses a global set::tls block to define default certificates and ciphers, while per-port options in the listen block enable TLS on specific ports like 6697. Administrators can enforce mandatory TLS for server links via link::options::tls directives, ensuring encrypted inter-server communication and preventing exposure. Self-signed certificates suffice for internal use, but public networks often employ for valid, automated renewals. The primary benefits of TLS in IRCd include protection of user credentials, such as NickServ passwords, and channel messages from interception on untrusted networks. It also mitigates risks like , with TLS-connected users on networks like receiving the +Z usermode to indicate secure status and access TLS-only features. Adoption has grown in modern networks; mandates TLS for SASL authentication in certain scenarios and provides it on all servers via ports 6697, 7000, and 7070. In the 2020s, IRCds like UnrealIRCd 6.x, released starting in December 2021, enable TLS by default on client ports and disable legacy protocols such as TLS 1.0 and 1.1 from version 6.0.5 onward to enforce forward secrecy. Recent developments address post-quantum threats, with UnrealIRCd 6.2.0 (2025) supporting hybrid key exchanges like X25519MLKEM768 via OpenSSL 3.0+, combining classical and post-quantum algorithms for future-proofing against quantum attacks. This integration allows administrators to configure multiple certificates supporting post-quantum cryptography, available since September 2025.

IPv4 and IPv6 Support

IRCd was originally designed in 1988 using IPv4 as the underlying network protocol, reflecting the era's internet infrastructure where IPv4 addresses were abundant and had not yet been standardized. This baseline ensured compatibility with early TCP/IP networks but became a limitation as global emerged in the late 1990s and early 2000s, prompting the development and gradual adoption of to accommodate growing internet-connected devices. Early IRCd implementations, such as those derived from the original ftpd-irc, lacked native support, relying solely on 32-bit IPv4 addresses for client-server communications and server linking. Modern IRCd software has evolved to incorporate dual-stack capabilities, allowing servers to handle both IPv4 and connections simultaneously without requiring separate instances. For instance, UnrealIRCd is compiled with IPv6 support by default, leveraging the operating system's dual IP stack to listen on both protocols, provided the host machine has an and routing. Similarly, InspIRCd enables administrators to bind to the IPv6 wildcard address "::" via the <options defaultbind="ipv6"> directive, facilitating AAAA DNS record resolution for server hostnames and supporting literal IPv6 addresses in configuration files for bans and access controls. ngIRCd also includes optional IPv6 connectivity, configurable through its [Options] section to enable or disable IPv6 server links. This dual-stack approach ensures while enabling IPv6-only clients to connect seamlessly. Despite these advancements, challenges persist in mixed IPv4/IPv6 environments, particularly in clustered networks where not all servers support both protocols. Incomplete IPv6 adoption can lead to "split-brain" scenarios, where portions of the network become isolated due to failed links over unsupported protocols, exacerbating netsplits during connectivity issues. Configuration must carefully handle IPv4-mapped IPv6 addresses (e.g., "::ffff:192.0.2.1") to avoid routing conflicts, and administrators often recommend full dual-stack deployment across all servers to mitigate fragmentation. As of 2025, major IRC networks like provide dedicated IPv6 entry points, such as irc.ipv6.efnet.org, indicating widespread but uneven integration across the ecosystem.

Linking and Clustering

Clustering Mechanisms

Clustering in IRCd enables multiple servers to interconnect and form a unified network, distributing computational load across multiple machines to handle large numbers of users, providing to mitigate single points of failure, and facilitating global reach through geographically dispersed servers. The resulting structure is a , often implemented as a to ensure efficient message propagation without loops. In this , hub servers connect to multiple other servers, serving as central points for inter-server traffic, while leaf servers primarily manage client connections and link only to a single hub, optimizing resource use in large . The linking process initiates when one server establishes a TCP connection to a designated port on another server, typically secured with TLS. Authentication occurs via the PASS command, where servers exchange shared passwords or cryptographic keys to verify mutual authorization before proceeding. Successful authentication triggers the exchange of SERVER messages containing server identifiers, versions, and capabilities, followed by the synchronization of network state. This , referred to as , involves the rapid transmission of initial state data, including via messages, channel memberships via JOIN or NJOIN messages, and mode settings to establish a consistent global view. Services bursting ensures persistence of operator privileges by having services like NickServ immediately reapply channel modes and operatorships post-link. To prevent synchronization loops and flooding during reconnections or splits, many IRCds incorporate netjoin delays, temporarily holding back certain state updates. Modern implementations in large networks, such as Libera.Chat—a successor to Freenode—employ hub-based topologies with multiple core hubs interconnecting regional leaves, enhancing scalability and reducing latency for international users.

Linking Protocols

The initial server-to-server linking protocol in IRCd, introduced in the late 1980s, was a simple text-based system over TCP/IP, where servers connected using the SERVER command following authentication via the PASS command, exchanging state information such as user and channel details through broadcast messages to form a spanning tree network. This foundational approach, detailed in the original IRC protocol specification, relied on plain ASCII text commands with a maximum length of 512 characters, including prefixes for origin identification and numerics for replies, enabling basic synchronization but lacking mechanisms for conflict resolution during network partitions. By the early , as IRC networks grew, the protocol evolved to address and efficiency needs; the P10 protocol, developed for the network around 2000, introduced prefix-based messaging with unique numerics (encoded in ) to identify servers and clients without revealing hostnames, reducing bandwidth through tokenization (e.g., PRIVMSG abbreviated as "P") and supporting features like BURST for rapid state exchange. P10's design emphasized server by using numeric prefixes in the format [NUMERIC PREFIX] [TOKEN] [DATA], such as "A[A5j P ABAAA :Foo", where the first two characters denote the server and the next three the client, allowing secure clustering without exposing infrastructure details. In parallel, timestamp-based protocols emerged in the mid- to handle netsplits—network partitions where servers temporarily disconnect and rejoin—by assigning creation timestamps to channels and users for . The TS protocol, originating from the 1996 split and implemented in ircd-hybrid, used timestamps to prioritize the earliest instance of a or channel mode upon reconnection, preventing abuse like mode wars. This evolved into TS6 in the late 1990s, adopted by servers like ratbox and , which extended timestamping to mode changes and user IDs (via unique identifiers), ensuring synchronized state during netbursts and reducing desynchronization risks through ordered mode handling. Hybrid-7, released in 1999 for and refined through 2005, built on TS with custom numerics, capability negotiation, and support for encrypted links, enhancing scalability for large networks while maintaining with earlier hybrid versions. Extensions like the PROTOCTL command, introduced in implementations such as ircd-hybrid and during the , allowed servers to negotiate protocol capabilities (e.g., extended channel modes or user IDs) at link time, enabling flexible adoption of features without breaking compatibility across diverse IRCd variants. In 1998, proposed IRCX as a extension to the core IRC protocol, incorporating XML-like structured commands (e.g., tagged DATA and PROP elements for properties like topics) and features such as support, SASL authentication, and channel-specific modes like for moderated chats, primarily to integrate with Chat services. Later developments included PTLink, a 2000s fork of the Hybrid core, which incorporated advanced linking features like enhanced encryption methods and operator controls while retaining timestamp-based synchronization for robust server clustering in mid-sized networks. Modern IRCds, such as InspIRCd 3.x (released starting 2018), employ a with configurable TLS-encrypted links, support for UNIX socket connections, and autoconnect mechanisms, allowing efficient multiplexing of multiple server inbound/outbound connections via dedicated bind ports and capability negotiation to handle high-traffic clustering without the anonymity focus of P10.

Configuration

Access and Operator Controls

In IRCd software, operator access is primarily configured through dedicated blocks or lines that authenticate users and grant elevated privileges upon successful login via the /OPER command. Traditionally, this is achieved using O-lines (or operator blocks in modern implementations), which specify a hostmask for the connecting user's IP or hostname and a password for verification. For example, in UnrealIRCd, the oper block requires a mask directive to restrict access to matching hosts and a password for authentication, enabling the user to become an IRC operator (IRCOp) and access administrative commands. Upon successful authentication, the operator gains privileges defined by an associated operclass, such as network administration capabilities, while the hostmask ensures only authorized connections from specified locations can log in. Classes in IRCd configuration group hosts or connections to enforce limits like maximum clients, ping frequencies, and queue sizes, which are applied to operator configurations to manage privileged access without overwhelming server resources. These classes are defined in separate class blocks and referenced in operator or allow blocks; for instance, UnrealIRCd's class blocks set parameters such as maxclients (e.g., higher limits for an "opers" class) and pingfreq, allowing operators to be placed in a dedicated class post-authentication for optimized handling of administrative traffic. This grouping prevents abuse by limiting concurrent operator logins or send/receive queues, while still providing necessary leeway for operational tasks compared to standard client classes. Operators often receive exemptions from certain restrictions to perform their duties, particularly in the interplay between I-lines (or allow blocks, which permit specific hosts to connect) and K-lines (bans that deny connections based on hostmasks). In configurations like Charybdis-derived IRCds, the kline_exempt flag in operator or auth blocks allows authenticated operators to bypass K-lines and X-lines (temporary or permanent bans), ensuring they can connect even if their host matches a ban intended for others; this exemption does not alter I-line permissions but overrides denial mechanisms for privileged users. Such features maintain network integrity by distinguishing administrative access from standard enforcement. Modern IRCds, such as Solanum (a Charybdis fork), integrate SASL (Simple Authentication and Security Layer) for enhanced operator security, allowing authentication against external services during the client handshake before full registration. In Solanum configurations, the need_sasl flag in auth or operator blocks mandates SASL for operator login, supporting mechanisms like PLAIN or SCRAM-SHA-256 to verify credentials securely without exposing passwords in plaintext over the network. This approach, compliant with IRCv3 extensions, links operator privileges to authenticated accounts in services packages like Atheme or Anope, reducing reliance on static hostmask/password pairs and mitigating risks from IP changes or spoofing.

Ban and Restriction Directives

In IRCd software, ban and restriction directives provide mechanisms for server administrators to limit access and prevent abuse by blocking specific users, hosts, IP addresses, or nicknames. These directives are typically configured through command-line interfaces available to IRC operators or directly in the server's configuration files, allowing for both temporary and permanent restrictions with optional reasons for enforcement. Common across major IRCd implementations like UnrealIRCd and InspIRCd, these tools enable precise control over network participation while minimizing disruption to legitimate users. The K-line directive implements a local ban on a server, targeting users based on a hostmask in the format user@host, which matches username and or IP patterns. It prevents matching users from connecting to that specific server and can be applied temporarily or permanently; for instance, in UnrealIRCd, the command /KLINE *@[example.com](/page/Example.com) 3600 Abuse sets a one-hour ban with a specified reason, immediately disconnecting any active matching clients. In InspIRCd, the syntax /KLINE user@host [duration] [reason] similarly supports durations like 1d for one day or 0 for permanence, applying only to the local server unless extended by clustering. These bans rely on DNS resolution for host verification, making them suitable for targeted restrictions rather than high-volume attacks. G-lines extend K-lines network-wide, propagating the ban across all linked servers to enforce consistent restrictions on a hostmask. Issued via commands like /GLINE *@[example.com](/page/Example.com) 7200 Spam in UnrealIRCd, they include a duration in seconds (e.g., 7200 for two hours) and a reason, ensuring the ban is shared through server links for global effect. InspIRCd's /GLINE follows a comparable format, with the ban applying to ident@host masks and optional temporary durations, allowing operators to coordinate abuse prevention across clusters. Unlike local K-lines, G-lines require careful use to avoid overreach, as they impact the entire network. Z-lines provide immediate IP-based bans for rapid response to threats like drone attacks or floods, bypassing DNS lookups and ident checks to disconnect clients at the connection stage. In UnrealIRCd, /ZLINE *@192.0.2.1 900 Flooding applies a 15-minute local ban on the specified IP, rejecting connections without full handshakes; a global variant, GZ-line, propagates this via /GZLINE. InspIRCd's /ZLINE ipaddr [duration] [reason] supports CIDR ranges (e.g., 192.0.2.0/24) and defaults to permanent if no duration is set, emphasizing its role in abuse prevention over hostmask bans. Z-lines are recommended sparingly due to their harsh, non-informative nature for banned users. Q-lines restrict specific nicknames to prevent squatting or unauthorized use, often reserving them for services bots or blocking abusive patterns. UnrealIRCd configures these via the ban nick block in unrealircd.conf, such as ban nick { mask "BadNick"; reason "Reserved"; }, which permanently disables the nickname server-wide and supports wildcard masks like *Bot* for broader application. In InspIRCd, the /QLINE nick [duration] [reason] command enforces global bans, e.g., /QLINE EvilBot 1h Harassment, propagating across the network to reject nickname registrations. These directives focus on nickname integrity rather than connection bans. E-lines serve as exception lists to exemptions from bans, allowing trusted users or hosts to bypass K-, G-, Z-, or Q-lines, particularly useful for whitelisting ISPs or services. In UnrealIRCd, exemptions are set with /ELINE *@trusted.com kGzQ 0 Exempt for permanent overrides on multiple ban types or via config blocks like except ban { mask *@ip; type all; }, applying locally or globally as needed. InspIRCd's /ELINE ident@host [duration] [reason] provides similar global exemptions, ensuring administrative flexibility without removing underlying bans. Operators are typically exempt from these restrictions by default through access controls. These ban and restriction directives also play a role in mitigating distributed denial-of-service (DDoS) attacks targeting IRC channels. Administrators can reach out to network operators or admins for coordinated mitigation efforts at the network level. Additionally, enabling channel-specific modes for flood protection, such as the +f mode in UnrealIRCd, allows for customizable limits on message rates and join floods to prevent channel disruption during attacks.

Network Management Settings

Network management settings in IRCd configurations enable administrators to maintain the integrity and of IRC networks by simulating server behaviors, controlling linking hierarchies, integrating services for distributed operations, and implementing protective measures against threats. These directives are typically defined in the ircd.conf file or equivalent, allowing precise control over server interactions without altering core protocols. For instance, they facilitate rapid response to network disruptions while ensuring seamless operations across clustered servers. Juping, or creating a "juped" server entry, is a technique to simulate a fake server connection, effectively taking over a server name to resolve hijacks, network splits, or malicious takeovers. This is achieved by issuing a SERVER command with a hopcount of 2 from a services server, which introduces the juped server into the topology and prevents the legitimate server from linking until the jupe is cleared. In UnrealIRCd, this mechanism is part of the server protocol for administrative control, often used by services packages like Anope or Atheme to enforce network isolation. The jupe includes a reason and expiration, configurable via oper commands, ensuring temporary disruptions do not persist indefinitely. H-lines define hub configurations to direct server links and enforce topology restrictions, such as designating which servers can act as hubs and for which upstream connections. The syntax, typically H:::::, allows a hub like eff.org to introduce any matching servers, while leaf servers use H-lines to limit their uplink's hubbing capabilities, preventing unauthorized expansions. This is essential for leaf nodes with single uplinks, where absence of an H-line assumes leaf behavior, and multiple H-lines can specify regional masks like *.edu for targeted control. In modern IRCds like derivatives, H-lines pair with L-lines (link restrictions) to optimize traffic flow in large networks. Services integration for clustered operations relies on U-lines, which grant elevated privileges to designated services servers, enabling them to manage shared channels across without per-channel operator status. Configured as U::: in the ircd.conf, U-lines allow services like NickServ or ChanServ to set modes, enforce policies, and synchronize states in real-time on linked servers. For example, in UnrealIRCd, ulines are defined in a shared configuration block, ensuring services can perform actions like channel mode enforcement or reservations network-wide. This setup supports clustered ops by propagating changes via server-to-server links, maintaining consistency during high-load scenarios. Shared channels, often using +L mode for forwarding messages between linked rooms, benefit from these configs to simulate unified spaces without direct user bans. Cloak modules provide host hiding to enhance user privacy and network security by masking real IP addresses and hostnames with hashed or obfuscated versions. In UnrealIRCd, the cloaking module (loaded by default) uses user mode +x, enabled via set::modes-on-connect, and requires identical secret cloak-keys across servers for consistent generation, such as transforming rox-2DCA3201.example.net to a masked form like a1b2c3.d4e5f6.example.net. Configuration includes set::cloak-method for IP-style cloaking, supporting netblock bans like /24 for IPv4. Similarly, InspIRCd's cloaking module adds mode +x with tags specifying full or half cloaking via hashing, a required key of 30+ characters, and optional prefixes like "MyNet-" for branded masks. These modules hide hosts in , JOIN/PART, and bans, reducing exposure to targeted attacks while allowing operators full visibility. In 2020s IRCds, anti-DDoS settings focus on flood throttling and reputation-based access to mitigate distributed attacks, with configurations emphasizing connection limits and integration. UnrealIRCd's set::anti-flood block includes connect-flood (e.g., 3:60 to limit attempts per IP) and connthrottle (default 30 per minute, exempting SASL-authenticated users), paired with DNS blacklists like DroneBL for preemptive blocking. The handshake-data-flood directive caps initial data at 4k bytes with Z-line bans, while target-flood limits messages (e.g., 45 channel PRIVMSGs per 5 seconds) to prevent overload. InspIRCd complements this with modules like connflood for startup wait times, messageflood (+f mode for spam protection), and joinflood (+j for mass-joins), configurable via tags to adjust durations and thresholds. These features, refined in releases like UnrealIRCd 6.2.0 and InspIRCd 3.x, integrate with provider-level for robust network resilience.

Setting up a custom IRC server on Linux

Setting up a custom IRC server on Linux involves installing and configuring a popular open-source IRC daemon. UnrealIRCd is widely recommended for beginners due to its rich feature set, active maintenance, and user-friendly configuration process. Using UnrealIRCd (recommended for beginners):
  1. Install the required prerequisites on Debian or Ubuntu-based systems:
    sudo apt update && sudo apt install build-essential libssl-dev pkg-config libcurl4-openssl-dev libargon2-dev libpcre2-dev libtre-dev
  2. Download the latest source code from the official website: https://www.unrealircd.org/download
  3. Extract the tarball and change into the extracted directory.
  4. Run ./Config to configure the build options, answering the interactive questions or accepting defaults where appropriate.
  5. Compile the software by running make.
  6. Install it using sudo make install (or make install if installing to a user-writable directory).
  7. Edit the main configuration file (typically conf/unrealircd.conf or similar) to define essential settings, including the server name, administrative information, listen ports (default 6667 for plaintext connections and 6697 for SSL/TLS), operator credentials, connection classes, and other parameters.
  8. Generate self-signed SSL certificates or obtain valid ones from a certificate authority if enabling TLS encryption.
  9. Start the server with ./unrealircd start.
  10. Test connectivity by using an IRC client to connect to localhost:6667 (or the server's public IP address and port).
For a full IRC network, multiple servers must be run and linked together through their respective configuration files, defining link blocks and shared settings. It is essential to secure the server properly: enable TLS for encrypted connections, use strong passwords for operator accounts, implement appropriate bans and restrictions, and follow best practices to prevent abuse and unauthorized access. Alternative: InspIRCd
InspIRCd provides similar capabilities with a comparable installation process, though it uses CMake as the build system instead of the ./Config script. The general steps involve installing dependencies, obtaining the source, configuring with CMake, building, installing, and editing configuration files.

References

Add your contribution
Related Hubs
User Avatar
No comments yet.