CentOS: Add extra IP addresses to DNS server

Hi All,

I have a VPS server with four IP addresses.  The server has DNS installed, but only one of the IP addresses is resolving names.

is there something i need to set to have the other IP addresses also resolve DNS?
LVL 2
detox1978Asked:
Who is Participating?
 
farzanjConnect With a Mentor Commented:
Sorry.
And don't forget to change the serial number.
Feel free to name as nic2, etc. as per your wishes.
Please modify the IP addresses appropriately.

Follow the rest of the steps as described above
nic2        IN       A        192.168.XX.XX
nic3        IN       A        192.168.XX.XY
nic4        IN       A        192.168.XX.ZZ

Open in new window

0
 
farzanjCommented:
You have to configure DNS for other IP addresses as well.  You have to enter IP addresses entries both in forward and reverse lookup zone files.
0
 
detox1978Author Commented:
where do i do this?

 have webmin installed if that helps?
0
Worried about phishing attacks?

90% of attacks start with a phish. It’s critical that IT admins and MSSPs have the right security in place to protect their end users from these phishing attacks. Check out our latest feature brief for tips and tricks to keep your employees off a hackers line!

 
farzanjCommented:
If you check your /etc/named.conf file, it should state the name of your forward and reverse lookup zone files.  Open each of these zone files to enter one record for each of the IP addresses you want to be resolved.
0
 
detox1978Author Commented:
this is all i have in that file
options {
    directory "/var/named";
};

zone "mydomain.com" {
    type master;
    file "m/mydomain.com";
};

Open in new window

0
 
farzanjCommented:
It appears that your mydomain.com file exists in

/var/named/chroot/var/named/m/mydomain.com

If you don't file it there you can do
updatedb   #This command takes some time

locate mydomain.com


Or you can use the find command

find /var/ -name mydomain.com
0
 
detox1978Author Commented:
I can see mydomain.com, isnt that the zone file?  I want to setup the ip addresses for the DNS server
0
 
farzanjCommented:
I want to make sure that we looked at the correct file

try this one
/var/named/chroot/etc/named.conf

Does it contain the exact same information.

I can only see one zone file, may be the forward lookup zone.

So you have to open the file and see its contents.  To enter more IP addresses, you may have to copy just last line and then paste it in the next line and then make adjustments in the domain name and Ip addresses.

Save the file and exit.

Then restart the service
service named restart

Test the new domain name
dig @localhost newdomainName
0
 
farzanjCommented:
If you can show me the zone file (after necessary changes of course), and give me the domain name you need with IP address for that name, I can tell you what entry your require.
0
 
detox1978Author Commented:
I dont think we are on the same page here, as the zone file shouldn't have anything to do with adding the extra IP addresses to DNS.

All I want to do is get all four IP addresses on the server to answer DNS queries - i.e.  want to run NSLOOKUP against all four ip addresses.
0
 
farzanjCommented:
This is exactly what I am trying to accomplish, if you would stay with me.

Once I know that we are looking at the correct zone file in the named.conf, then you can open the zone file and see the records yourself.  If you don't trust me, I can give you references.  So, how should I help you?
0
 
detox1978Author Commented:
/etc/named.conf is above and /var/named/chroot/var/named/m/mydomain.com is below
$TTL 2H
@       IN      SOA     dns1.mydomain.com. hostmaster.mydomain.com. (
                        1299895802                      ; serial
                        8H                              ; refresh
                        2H                              ; retry
                        4W                              ; expire
                        2H )                            ; minimum TTL

                NS      dns1.mydomain.com.                 ; name server
                NS      dns2.mydomain.com.                 ; name server
                MX      10 mail.mydomain.com.              ; mail exchanger
            	A       192.168.0.90
*        	    A       192.168.0.90
mail        	A       192.168.0.90
www        	    A       192.168.0.90

Open in new window

0
 
farzanjCommented:
Reference:
http://www.redhat.com/magazine/026dec06/features/dns/

Search on this page for "etc"

You will see the config file directing to the zone file.

Now search for "zone files"

You will see zone files there
0
 
farzanjCommented:
Ok.

1.  Increase serial number by 1.
2.  Add this record

nic2        IN       A        192.168.XX.XX
nic3        IN       A        192.168.XX.XY


Restart the service

service named restart

Test
dig @localhost nic2.mydomain.com      
0
 
farzanjCommented:
You can always use FQDN -- fully qualified domain name in the zone file.  But you will have to put a "dot" at the end to show it is FQDN.

For example,

you could say
nic1   IN   A   XX.XX.XX.XX

OR
nic1.mydomain.com.    IN       A      XXX.XXX.XX.XX
0
 
detox1978Author Commented:
That will create two new records nic1.mydomain.com  & nic2.mydomain.com  

I want to add three additional IP addresses to the DNS server.
0
 
farzanjCommented:
Every time you modify an entry, you need to increase the serial number at the top of the file.
0
 
detox1978Author Commented:
Thats creating records.

I have noticed the new IP addresses i added are not responding to ping.  Is there a way to list the ip address info (similar to windows ipconfig/all)
0
 
farzanjCommented:
Issue the following command

 
ip a

Open in new window


You can also issue the following
ifconfig

Open in new window

0
 
farzanjCommented:
Are the target machines pointing to this DNS server?  Are they CentOS too?

If you are checking one the same machine and the following command returns an answer
dig @localhost nic2.mydomain.com

Then the DNS server is basically working.
0
 
detox1978Author Commented:
It's a single server with DNS installed.  I've added three extra IP address via my VPS control panel, but NSLOOKUPs and PING dont work against them.
0
 
detox1978Author Commented:
I should have four addresses;

192.168.0.90
192.168.0.91
192.168.0.92
192.168.0.93

below is the nic info
eth0      Link encap:Ethernet  HWaddr 00:11:3C:2B:0D:BC
          inet addr:192.168.0.90  Bcast:192.168.0.95  Mask:255.255.255.248
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4163 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1879 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:338276 (330.3 KiB)  TX bytes:1945801 (1.8 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:9 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1287 (1.2 KiB)  TX bytes:1287 (1.2 KiB)

Open in new window

0
 
farzanjCommented:
Issue the following commands


ip a

ifup eth1
ifup eth2
ifup eth3

ip a

Open in new window

0
 
detox1978Author Commented:
ip a information above;  others below;
-bash-3.2# ifup eth1
/sbin/ifup: configuration for eth1 not found.
Usage: ifup <device name>
-bash-3.2# ifup eth2
/sbin/ifup: configuration for eth2 not found.
Usage: ifup <device name>
-bash-3.2# ifup eth3
/sbin/ifup: configuration for eth3 not found.

Open in new window

0
 
farzanjCommented:
Issue the following command
cat /etc/sysconfig/network-scripts/ifcfg-eth*

The issue this one
ip a

I need to see MAC addresses and whether they are actually recognized by the system
0
 
detox1978Author Commented:
I've added them as virtual adapters using webmin, so the now respond to ping and can have websites assigned to them.  However NSLOOKUP still fails.
0
 
farzanjCommented:
Please give me the output of

dig @localhost nic2.mydomain.com
Likewise for others.

DO YOU GET ANY ANSWER IN THE ANSWER SECTION

Is answer count 1?
0
 
detox1978Author Commented:
Why do you want me to create a record for nic2.mydomain.com?
0
 
detox1978Author Commented:
I'm doing the NSLOOKUP against the IP address.
0
 
farzanjCommented:
I thought, you needed a different name for each nic.  Also, it is hypothetical name.  Just "dig" against whatever you are trying to find.  I want to see it with @localhost.  I don't care what you call it.
0
 
detox1978Author Commented:
I want to be able to use NSLOOKUP against each three new IP addresses
0
 
farzanjCommented:
How do you do "nslookup" to force it to use a specific DNS?
0
 
farzanjCommented:
I am sure, it can be done may be by the interactive version, but dig is a far superior utility.
0
 
detox1978Author Commented:
> nslookup
> server 192.168.0.91
0
 
farzanjCommented:
Don't say 192.168.0.91.

Say, localhost.

And then tell me if you get a response?
0
 
detox1978Author Commented:
I'm doing the NSLOOKUP from another server.
0
 
farzanjCommented:
Please do it for the same machine first.  I want to see if DNS is working right. Once that is established, then I want to see why other server is not able to figure it out
0
 
detox1978Author Commented:
NSLOOKUP works against the orginal IP address, i have added three new IP addresses, but they don't work.
0
 
detox1978Author Commented:
-bash-3.2# dig @localhost nic1.mydomain.com
dig: parse of /etc/resolv.conf failed


I can use NSLOOKUP from another server against the orginal IP address and it can see the IP for nic1.mydomain.com
0
 
farzanjCommented:
Ok, for the new one that don't work:

Go to the ZONE file again.  Increase the serial number by one

And restart the service

service named restart

Then try
0
 
detox1978Author Commented:
I still dont understand why you want me to create new records.

0
 
farzanjCommented:
Am I correct that you needed a different name for each IP address.  If so, you need to create a new record for each one.  If you want to give the same domain name four different IP addresses, you can sure do that too.  Again you need to add records.  If you don't put records in the zone files, it doesn't have any other means to know you want them to be resolved too.  This is like you cannot expect something from a database if you don't have it in the database.
0
 
farzanjCommented:
If you did not put those records in the zone files and we are trying to pull something from the database that was never put into it to begin with, then we are simply wasting our time.  These records are in Berkley Database.  They cannot be queried unless first entered.
0
 
detox1978Author Commented:
I'm not interested in setting any new names up.  

I've added three new IP addresses to my DNS server, but i can not perform NSLOOKUP against them.

0
 
farzanjCommented:
Once you have entered those records, you may restart the service as describe above.  If a host can pull it only by providing the server name and not without that, then you will need to put the nameserver record in the /etc/resolv.conf file.
0
 
detox1978Author Commented:
It looks like the VPS HOST is blocking the port
0
 
farzanjCommented:
Is your record looking something like?

yahoo.com.            5      IN      A      69.147.125.65
yahoo.com.            5      IN      A      72.30.2.43
yahoo.com.            5      IN      A      98.137.149.56
yahoo.com.            5      IN      A      209.191.122.70
yahoo.com.            5      IN      A      67.195.160.76


Did you increase the serial number?

Did you restart the named service?

Did you try to do nslookup by mentioning the server name?
0
 
farzanjCommented:
First step is to ALWAYS check from the same host where DNS is configured.  This way you know whether DNS is working or not.  Based on your responses, I have not been able to establish anything.  It gets a little tough to help when you don't know what the other person is doing.
0
 
farzanjCommented:
I hope the issue resolves.

Good luck to you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.