Q:

Smarter justifying in OpenOffice

Open a new document in OpenOffice, ensure that the default font is size 12 Times New Roman and set the alignment to justify. Now, paste or type the following (all on one line, ignore the reformatting here).

I will ping the servers: stash.ronald.mcdonalds.com and secretstuff.steveballmersdesktop.microsoft.com.

Notice how the first line has untenably large spaces between the words in order to reach the far edge of the screen since the last domain is huge and has to wrap to the next line. (I suspect that the same might happen in MS Word, but I don't have a copy to test with.)
How can I make justify "smarter" and let it know that in this case it would be ok to split the domains on the "." as well as on spaces? Is there an alternate solution to this problem that renders a document that's a bit more appealing to the eye? Assume that the document as a whole needs to be justified, and just switching to left-align is not an option.

A:

Another option is to use automatic hyphenation.  Even without long domains in your text, it generally makes justified text look better.  Unfortunately, your domain names won't break at the period, but have hyphens inserted instead.
To enable automatic hyphenation, select Paragraph from the Format menu, and select the Text Flow tab.  Under Hyphenation, check Automatically.  Note that OpenOffice's automatic hypehnation behavior is configurable so you can adjust the look if necessary:

