How to add an entry in a subdomain without adding the domain

So you need a subdomain in your dns but you only need one and don’t want to create a whole new file… well it’s really easy…

 

Assume that you are editing the zone file for b.domain.com and you want to add www.a.b.domain.com just add this to b.domain.com

 

www.a.b.domain.com    IN A 10.10.10.41

How to setup more than one ip address in dns (DNS Round robin)

So I bet you have seen what happens when you look up the Ip address for google.com .. you get five or six different IP addresses your client takes the first one…   for example

 

nslookup google.com

Non-authoritative answer:
Name:   google.com
Address: 74.125.225.145
Name:   google.com
Address: 74.125.225.144
Name:   google.com
Address: 74.125.225.148
Name:   google.com
Address: 74.125.225.147
Name:   google.com
Address: 74.125.225.146

 

Lets do that again:

Non-authoritative answer:
Name:   google.com
Address: 74.125.225.144
Name:   google.com
Address: 74.125.225.145
Name:   google.com
Address: 74.125.225.148
Name:   google.com
Address: 74.125.225.147
Name:   google.com
Address: 74.125.225.146

Notice how the order changes?  That is DNS round robin and your machine will use the first IP address it gets producing a type of poor mans (or womans) load balancer. It works great but how do you do it in DNS so that it works?

 

The best way is to load multiple A records inside DNS like this:

www.awesome.com        IN A  10.10.10.2

www.awesome.com        IN A 10.10.10.3

www.awesome.com        IN A 10.10.10.4

 

Another way is the following:

 

www.awesome      IN A 10.10.10.2

IN A 10.10.10.3

IN A 10.10.10.4