The telnet client looks for the configuration files in /etc/telnetrc and ~/.telnetrc - in this order exactly.

telnetrc syntax

A quote from a manpage:

The format of the telnetrc files is as follows: Lines beginning with a #, and blank lines, are ignored.

The rest of the file should consist of hostnames and sequences of telnet commands to use with that host.

Commands should be one per line, indented by whitespace; lines beginning without whitespace are interpreted as hostnames.

Lines beginning with the special hostname ‘DEFAULT’ will apply to all hosts.

Hostnames including ‘DEFAULT’ may be followed immediately by a colon and a port number or string.

If a port is specified it must match exactly with what is specified on the command line. If no port was specified on the command line, then the value ‘telnet’ is used. Upon connecting to a particular host, the commands associated with that host are executed.

telnetrc example

# This is a comment
 mode character
 set binary