// Module included in the following assemblies:
//
// assembly-kafka-broker-external-listeners.adoc

[id='con-kafka-broker-external-listeners-addresses-{context}']

= Customizing advertised addresses on external listeners

By default, {ProductName} tries to automatically determine the hostnames and ports that your Kafka cluster advertises to its clients.
This is not sufficient in all situations, because the infrastructure on which {ProductName} is running might not provide the right hostname or port through which Kafka can be accessed.
You can customize the advertised hostname and port in the `overrides` property of the external listener.
{ProductName} will then automatically configure the advertised address in the Kafka brokers and add it to the broker certificates so it can be used for TLS hostname verification.
Overriding the advertised host and ports is available for all types of external listeners.

.Example of an external listener configured with overrides for advertised addresses
[source,yaml,subs="attributes+"]
----
# ...
listeners:
  external:
    type: route
    authentication:
      type: tls
    overrides:
      brokers:
      - broker: 0
        advertisedHost: example.hostname.0
        advertisedPort: 12340
      - broker: 1
        advertisedHost: example.hostname.1
        advertisedPort: 12341
      - broker: 2
        advertisedHost: example.hostname.2
        advertisedPort: 12342
# ...
----

Additionally, you can specify the name of the bootstrap service.
This name will be added to the broker certificates and can be used for TLS hostname verification.
Adding the additional bootstrap address is available for all types of external listeners.

.Example of an external listener configured with an additional bootstrap address
[source,yaml,subs="attributes+"]
----
# ...
listeners:
  external:
    type: route
    authentication:
      type: tls
    overrides:
      bootstrap:
        address: example.hostname
# ...
----
