Solved

Resolve dns name with linux box

Posted on 2004-09-08
9
2,925 Views
Last Modified: 2008-01-09
Hi.

I have a linux server running Redhat Fedora Core 2. I have a hosts file which looks like the following:

/etc/hosts
10.0.1.2 game1
10.0.1.2 game2
10.0.1.2 game3
10.0.1.3 app1

I am running dhcp for my windows clients. I would not like to know if it is possible for my windows machines to type:

ping game1

And for this to resolve without entering anything in the windows hosts file?

Thanks in advance.
0
Comment
Question by:bobbyo
  • 4
  • 4
9 Comments
 
LVL 3

Accepted Solution

by:
ivyfranklin earned 500 total points
ID: 12009273
In order for this to work you will either need to provide your own DNS server or WINS server.  If you go to http://langfeldt.net/DNS-HOWTO/BIND-9/ you will find a nice and simple tutorial on how to roll your own DNS server.  I'm not sure if fedora includes it or not, but the redhat-config-bind utility is pretty simple to use if you know what you are supposed to be doing.  If you need more help with setting up a DNS server I can give more detailed instructions.

Once you have a working DNS server then you can have your DHCP server hand out the IP address of the new DNS server instead of your ISP's DNS server.  I use this setup at home and it works great.
0
 
LVL 3

Expert Comment

by:ivyfranklin
ID: 12009509
You could also setup a WINS server if you are running SAMBA on your linux box.  Basically you just need to make sure that game1, game2, etc. are all either Windows boxes or are running Samba and then all of the windows boxes need to be setup to use the new WINS server through DHCP broadcast or by setting the IP address of the WINS server manually on each machine.  I hope this helps.  I guess if you are looking for a simple and elegant solution, I don't know of one.  Both of these two solutions are fairly complex and will require some configuring.  The easiest solution for a small network is to just use hostfiles.
0
 
LVL 1

Author Comment

by:bobbyo
ID: 12009715
I have setup a DNS server. However the DNS server does not resolve entries I have put in the hosts file. I was hoping for this. I would like to just use single string like game1 or game2 i.e. http://game1/

I don't want to have to enter something like http://game1.mydomain.com/

Anyway, my DNS server is running, but is not resolving what I have entered in the hosts file, will/can it do this?

Thanks
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 3

Expert Comment

by:ivyfranklin
ID: 12010865
On the linux machines you need to add the following line to /etc/resolv.conf

search mydomain.com

On the Windows machines you need to add mydomain.com to the DNS search path under the IP configuration.  In Windows XP & 2000 this is found under:

Network Connections->Local Area Connection (properties)->TCP/IP (properties)->Advanced->DNS->Append these DNS suffixes in order

On the Windows machines if you only have one domain that you would like to use in this manner then you might be able to get by with just making sure that the domain is entered as the DNS suffix for this connection and selecting "Append primary and connection specific DNS suffixes".  If you are trying to do this on Win9x machines I'm not sure quite how to do it, but if you need help, then I will look into it for you.

good luck
0
 
LVL 3

Expert Comment

by:ivyfranklin
ID: 12010895
Also I just reread your post, and I think you may not have your DNS server setup properly.  named (The DNS server program) doesn't ever look at /etc/hosts.  You have to add all of the host names that you want to resolve properly to a zone file for your domain name.  The syntax for these files was specified in the tutorial I sent you earlier.  There are also some gui configurators that will work also (redhat-config-bind) is one of these.
0
 
LVL 1

Author Comment

by:bobbyo
ID: 12012921
I am going to take a look at this later. thanks for your help so far. I will let you know. Can you specify the DNS suffix in DHCP?
0
 
LVL 5

Expert Comment

by:paranoidcookie
ID: 12013972
Yes you can specify the dns suffix and indeed many other options from a dhcp server
Take a look at http://linux.about.com/library/cmd/blcmdl5_dhcp-options.htm
If you are using dhcp3-server you can even configure dynamis updates of your bind server (although this might be a little bit overkill in your situation).
0
 
LVL 1

Author Comment

by:bobbyo
ID: 12013987
I am assuming you would use the option domain-name text;  option?
0
 
LVL 1

Author Comment

by:bobbyo
ID: 12018501
Excellent, the DNS solutions works like a charm. Thanks for all the help
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
connect an Odroid to Windows PC via ethernet cable? 14 382
how to view remote client's ipv6 address? 5 78
linux, squid server 23 59
Setup static routes for IP address in CentOS 2 67
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 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