How can i generate random DNS names of Hosts in java
<p>this could be of the form:</p>

<p>aaa1.bbb2.ccc3.ddd4</p>

<p>Maybe taking a cue from <a href="http://www.dnsjava.org/download/" rel="nofollow">http://www.dnsjava.org/download/</a>
and first generating individual strings aaaa1 , bbb2 etc and then using join()</p>

<p>or</p>

<pre><code>String validCharacters = $('a', 'z').join() + $('A', 'Z').join();

String randomString(int length) {
    return $(validCharacters).shuffle().slice(length).toString();
}

@Test
public void buildFiveRandomStrings() {
    for (int i : $(5)) {
        System.out.println(randomString(12));
    }
}
</code></pre>
