+++++++++ name of server1 +++++++++
eth1 <ip-of-eth1> <fqdn>
eth3 <ip-of-eth3> <fqdn>
eth4 <ip-of-eth4> <fqdn>
=========================
+++++++++ name of server2 +++++++++
eth1 <ip-of-eth1> <fqdn>
eth3 <ip-of-eth3> <fqdn>
eth4 <ip-of-eth4> <fqdn>
=========================
+++++++++ name of server3 +++++++++
eth1 <ip-of-eth1> <fqdn>
eth2 <ip-of-eth2> <fqdn>
=========================
When I execute it, it gives "paste: /dev/fd/63" No such file or directory".
It is not mandatory to use paste command, anything will work which can put the interface (eth0, ethx, bondx etc) ip address:wall and fqdn of that ip in the same line with a space or tab between them.
I have used a meaningful variable name rather than just i and read the file into a while loop. It is clearer to read and the input does not risk get eaten up by the commands within the loop.
The line ending \ can have nothing after it. It means that the new-line is ignored, so on execution it is joined up but means it is somewhat easier to read.
I would suggest you are trying to do too much in one step with pipes from the output to grep, then awk, then cut, then xargs, then cut, then cut, then grep, then cut and finally sed
A tool like awk can do all of this (although it might need to call out to nslookup) which will neaten your code too.
Can you explain what you are actually trying to achieve? I think I've got it, but if I have misinterpreted, I don't want to write it out and have you think that I've got it.