Nodes discover their own external address by various methods.
Nodes receive the callback address of remote nodes that connect to them.
Nodes connect to IRC to receive addresses.
Nodes makes DNS request to receive IP addresses.
Nodes can use addresses hard coded into the software.
Nodes exchange addresses with other nodes.
Nodes store addresses in a database and read that database on startup.
Nodes can be provided addresses as command line arguments
Nodes read addresses from a user provided text file on startup
https://en.bitcoin.it/wiki/Satoshi_Client_Node_Discovery