Solved

CentOS:  Add extra IP addresses to DNS server

Posted on 2011-03-13
49
1,003 Views
Last Modified: 2013-11-08
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?
0
Comment
Question by:detox1978
  • 28
  • 21
49 Comments
 
LVL 31

Expert Comment

by:farzanj
ID: 35124694
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
 
LVL 2

Author Comment

by:detox1978
ID: 35124698
where do i do this?

 have webmin installed if that helps?
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35124701
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
 
LVL 2

Author Comment

by:detox1978
ID: 35124716
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35124755
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
 
LVL 2

Author Comment

by:detox1978
ID: 35124765
I can see mydomain.com, isnt that the zone file?  I want to setup the ip addresses for the DNS server
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35124784
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35124792
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
 
LVL 2

Author Comment

by:detox1978
ID: 35124799
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35124815
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
 
LVL 2

Author Comment

by:detox1978
ID: 35124845
/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
 
LVL 31

Expert Comment

by:farzanj
ID: 35124858
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35124888
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35124895
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
 
LVL 2

Author Comment

by:detox1978
ID: 35124914
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
 
LVL 31

Accepted Solution

by:
farzanj earned 500 total points
ID: 35124928
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35124939
Every time you modify an entry, you need to increase the serial number at the top of the file.
0
 
LVL 2

Author Comment

by:detox1978
ID: 35124966
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35124974
Issue the following command

 
ip a

Open in new window


You can also issue the following
ifconfig

Open in new window

0
 
LVL 31

Expert Comment

by:farzanj
ID: 35124995
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
 
LVL 2

Author Comment

by:detox1978
ID: 35125000
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
 
LVL 2

Author Comment

by:detox1978
ID: 35125007
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35125016
Issue the following commands


ip a

ifup eth1
ifup eth2
ifup eth3

ip a

Open in new window

0
 
LVL 2

Author Comment

by:detox1978
ID: 35125029
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 31

Expert Comment

by:farzanj
ID: 35125044
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
 
LVL 2

Author Comment

by:detox1978
ID: 35125061
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35125069
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
 
LVL 2

Author Comment

by:detox1978
ID: 35125075
Why do you want me to create a record for nic2.mydomain.com?
0
 
LVL 2

Author Comment

by:detox1978
ID: 35125079
I'm doing the NSLOOKUP against the IP address.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35125082
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
 
LVL 2

Author Comment

by:detox1978
ID: 35125085
I want to be able to use NSLOOKUP against each three new IP addresses
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35125087
How do you do "nslookup" to force it to use a specific DNS?
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35125090
I am sure, it can be done may be by the interactive version, but dig is a far superior utility.
0
 
LVL 2

Author Comment

by:detox1978
ID: 35125091
> nslookup
> server 192.168.0.91
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35125096
Don't say 192.168.0.91.

Say, localhost.

And then tell me if you get a response?
0
 
LVL 2

Author Comment

by:detox1978
ID: 35125097
I'm doing the NSLOOKUP from another server.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35125101
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
 
LVL 2

Author Comment

by:detox1978
ID: 35125104
NSLOOKUP works against the orginal IP address, i have added three new IP addresses, but they don't work.
0
 
LVL 2

Author Comment

by:detox1978
ID: 35125112
-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
 
LVL 31

Expert Comment

by:farzanj
ID: 35125148
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
 
LVL 2

Author Comment

by:detox1978
ID: 35125170
I still dont understand why you want me to create new records.

0
 
LVL 31

Expert Comment

by:farzanj
ID: 35125186
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35125208
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
 
LVL 2

Author Comment

by:detox1978
ID: 35125209
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35125216
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
 
LVL 2

Author Closing Comment

by:detox1978
ID: 35125225
It looks like the VPS HOST is blocking the port
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35125234
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35125248
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35125253
I hope the issue resolves.

Good luck to you.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Joining Domain Issue 4 37
Linux Scripting 3 53
parse convert xml feed to text (python) 2 31
DNS Name Pointing 6 28
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now