By default, the name before the :
is the hostname
of the device at the time that the shell command is spawned. Based on your example above, you connected to a network where the IP address that you are using (were using at the time that you spawned the new shell in Terminal) had a domain name that revered to a-12-345-67-89.foo.something.com
(or something similar).
This is a problem that's pretty common when you are on a non-NAT network (some public internet access, some coffee houses, certain corporate or educational networks), where the names are not dynamic.
When your computer is on a NAT network, such as in a home, there usually isn't a reverse name for your IP address, in which case the hostname
command will return the name of your machine as described in the Network
settings panel.
The easy way to change this back (once you've left that network) is to close the shell and re-open the tab or window. Leaving the network can mean turning off your WIFI temporarily or going to a network that doesn't have reverse name configurations.
For a permanent "fix" you can change your prompt string for your shell (see the man
page for your specific shell, as they each have different requirements and capabilities).