LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-14-2012, 06:56 AM   #1
rytec
Member
 
Registered: Mar 2009
Location: Belgium
Distribution: Ubuntu server 12.04 LTS / Raspbian Wheezy
Posts: 64

Rep: Reputation: 7
Where do I have to add the name of the DNS server


When I perform a NSlookup on my server it gives me the response like this :

Server: 127.0.0.1
Address: 127.0.0.1#53

Where in bind is it possible to change the IP behind Server: to the name of my server?
 
Old 03-14-2012, 12:05 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

The resolver is defined in /etc/resolv.conf and it's not possible to use hostnames in place of IPs
 
1 members found this post helpful.
Old 03-14-2012, 03:01 PM   #3
rytec
Member
 
Registered: Mar 2009
Location: Belgium
Distribution: Ubuntu server 12.04 LTS / Raspbian Wheezy
Posts: 64

Original Poster
Rep: Reputation: 7
OK, thanks for your reply, can you also tell me why it is not possible to give it names? because on a sbs server I get a name for the nameserver when I perform a nslookup
 
Old 03-14-2012, 04:50 PM   #4
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
your resolve should look something like this:

Code:
# cat /etc/resolv.conf
hosts,dns
nameserver 192.168.2.1
nameserver 209.92.1.12
 
Old 03-14-2012, 05:32 PM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by rytec View Post
OK, thanks for your reply, can you also tell me why it is not possible to give it names? because on a sbs server I get a name for the nameserver when I perform a nslookup
You understand that you cannot use a hostname as the nameserver argument in /etc/resolv.conf, because you'll need another resolver to resolve it. I guess sbs is some sort of windows, because IIRC windows nslookup answer uses the dns hostname in the response "Server" line.
In linux you can run nslookup like this:
Code:
nslookup linuxquestions.com localhost
Server:         localhost
Address:        127.0.0.1#53

Non-authoritative answer:
Name:   linuxquestions.com
Address: 174.137.125.92
to get the same result

Cheers
 
1 members found this post helpful.
Old 03-15-2012, 02:54 AM   #6
rytec
Member
 
Registered: Mar 2009
Location: Belgium
Distribution: Ubuntu server 12.04 LTS / Raspbian Wheezy
Posts: 64

Original Poster
Rep: Reputation: 7
Quote:
Originally Posted by lleb View Post
your resolve should look something like this:

Code:
# cat /etc/resolv.conf
hosts,dns
nameserver 192.168.2.1
nameserver 209.92.1.12
Indeed, but I do not have that line with hosts,dns
I have read the man resolv.conf page and even there I cannot find anything about that line hosts,dns
Can you explain a bit more please?

thank you
 
Old 03-15-2012, 03:11 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Indeed, but I do not have that line with hosts,dns
I have read the man resolv.conf page and even there I cannot find anything about that line hosts,dns
Can you explain a bit more please?
This is obviously wrong. You cannot have a line "hosts,dns" in /etc/resolv.conf. I guess that the previous poster is talking about the:
Code:
hosts:   files dns
in /etc/nsswitch.conf, that is used by application when trying to resolve hostnames

Regards
 
Old 03-15-2012, 08:07 AM   #8
RobertEachus
Member
 
Registered: Dec 2011
Posts: 32

Rep: Reputation: 8
The DNS server isn't "named" in the configuration. It has to be named in DNS, here is an example that creates the reverse zone for 127.0.0.0/24 on the DNS server. If your DNS server has a public IP address you will need to make sure the reverse zone is delegated to your DNS server.

----------------------ZONE STATMENT FROM NAMED.CONF-------------------------
Code:
zone "0.0.127.in-addr.arpa" in{
  type master;
  file "0.0.127.in-addr.arpa";
  allow-update{none;};
};
----------------------FILE: 0.0.127.in-addr.arpa----------------------------
Code:
$TTL    86400
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      localhost.

1       IN      PTR     DNSSERVER.yourdomainname.com.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] dns server configuration to add new domain bakrynor Linux - Server 10 05-19-2010 10:37 AM
How to add two domain on DNS server (not subdomain) AK007HK Linux - Server 8 07-05-2008 12:29 AM
Add a new server host to the DNS davidtcw Linux - Newbie 3 02-16-2006 09:30 PM
add a subdomian in the dns server bind papitu76 Linux - Software 3 01-07-2005 02:56 AM
How to add BIND DNS server to startup in Red Hat? BxBoy Linux - Networking 4 03-01-2004 12:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration