LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-20-2013, 08:46 PM   #1
afreitascs
Member
 
Registered: Aug 2004
Distribution: Debian
Posts: 443

Rep: Reputation: 30
Command to know dns ?


With what command says dns I am using in slackware?

thanks
 
Old 02-20-2013, 09:11 PM   #2
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,259

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by afreitascs View Post
With what command says dns I am using in slackware?

thanks
cat /etc/resolv.conf maybe? If I understood your question correctly.
 
Old 02-20-2013, 09:22 PM   #3
afreitascs
Member
 
Registered: Aug 2004
Distribution: Debian
Posts: 443

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by stormtracknole View Post
cat /etc/resolv.conf maybe? If I understood your question correctly.
thanks for the replies

Quote:
$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.1
I was wondering, with which command shows me the dns server I use to surf the internet

very thanks
 
Old 02-20-2013, 09:25 PM   #4
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,259

Rep: Reputation: 231Reputation: 231Reputation: 231
Your dns in this case would be: 192.168.1.1
 
Old 02-20-2013, 09:35 PM   #5
afreitascs
Member
 
Registered: Aug 2004
Distribution: Debian
Posts: 443

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by stormtracknole View Post
Your dns in this case would be: 192.168.1.1
thanks for the replies and patience

my dns is configured to use Google Public DNS!

Quote:
8.8.8.8
8.8.4.4
I want to know what command tells me this?

thanks
 
Old 02-20-2013, 09:42 PM   #6
shrourdian
LQ Newbie
 
Registered: Apr 2012
Location: indonesia
Distribution: on the way to slackware
Posts: 8

Rep: Reputation: Disabled
hi, i use dig or nslookup command
 
Old 02-20-2013, 09:53 PM   #7
afreitascs
Member
 
Registered: Aug 2004
Distribution: Debian
Posts: 443

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by shrourdian View Post
hi, i use dig or nslookup command
thanks for the replies

please you care to explicitly better your answer?

thanks
 
Old 02-20-2013, 10:29 PM   #8
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by afreitascs View Post
thanks for the replies

please you care to explicitly better your answer?

thanks
Right here goes.

1) If you're using DHCP, the DHCP server will write the DNS server(s) in your /etc/resolv.conf. On a desktop client in my office, here's how that looks:

Code:
[kikinovak@alphamule:~] $ cat /etc/resolv.conf 
# Generated by dhcpcd from eth0
# /etc/resolv.conf.head can replace this line
domain microlinux.montpezat
search microlinux.montpezat
nameserver 192.168.2.1
# /etc/resolv.conf.tail can replace this line
If you wonder where the magic comes from, it's from the DHCP server which is configured like this:

Code:
# /etc/dhcpd.conf
authoritative;
default-lease-time 86400;
max-lease-time 86400;
option broadcast-address 192.168.2.255;
option subnet-mask 255.255.255.0;
option routers 192.168.2.254;
option domain-name-servers 192.168.2.1;
option domain-name "microlinux.montpezat";
option domain-search "microlinux.montpezat";

subnet 192.168.2.0 netmask 255.255.255.0 {
  range 192.168.2.100 192.168.2.200;
}

host alphamule {
  hardware ethernet 00:21:97:4C:37:27;
  fixed-address 192.168.2.2;
  option host-name "alphamule";
}

...


2) If your setup is static (like on a server, for example), you can edit /etc/resolv.conf manually and put your nameserver(s) in it. The minimal syntax looks like this:

Code:
nameserver 8.8.8.8
Or:

Code:
nameserver 8.8.8.8
nameserver 4.4.4.4
On my office server (running it's own DNS server), here's how things are configured:

Code:
[root@nestor:~] # cat /etc/resolv.conf 
# /etc/resolv.conf
domain microlinux.montpezat
search microlinux.montpezat
nameserver 127.0.0.1
Hope that helps,

Niki
 
Old 02-20-2013, 10:32 PM   #9
afreitascs
Member
 
Registered: Aug 2004
Distribution: Debian
Posts: 443

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by stormtracknole View Post
Your dns in this case would be: 192.168.1.1
you made ​​me discover my mistake!

I did

Quote:
#pppoe-config
configured to use Google Public DNS

Quote:
8.8.8.8
8.8.4.4
now

Quote:
base1@base1:~$ cat /etc/resolv.conf
# MADE-BY-RP-PPPOE
nameserver 8.8.8.8
nameserver 8.8.4.4
thank you very much
 
Old 02-20-2013, 10:33 PM   #10
afreitascs
Member
 
Registered: Aug 2004
Distribution: Debian
Posts: 443

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by kikinovak View Post
Right here goes.

1) If you're using DHCP, the DHCP server will write the DNS server(s) in your /etc/resolv.conf. On a desktop client in my office, here's how that looks:

Code:
[kikinovak@alphamule:~] $ cat /etc/resolv.conf 
# Generated by dhcpcd from eth0
# /etc/resolv.conf.head can replace this line
domain microlinux.montpezat
search microlinux.montpezat
nameserver 192.168.2.1
# /etc/resolv.conf.tail can replace this line
If you wonder where the magic comes from, it's from the DHCP server which is configured like this:

Code:
# /etc/dhcpd.conf
authoritative;
default-lease-time 86400;
max-lease-time 86400;
option broadcast-address 192.168.2.255;
option subnet-mask 255.255.255.0;
option routers 192.168.2.254;
option domain-name-servers 192.168.2.1;
option domain-name "microlinux.montpezat";
option domain-search "microlinux.montpezat";

subnet 192.168.2.0 netmask 255.255.255.0 {
  range 192.168.2.100 192.168.2.200;
}

host alphamule {
  hardware ethernet 00:21:97:4C:37:27;
  fixed-address 192.168.2.2;
  option host-name "alphamule";
}

...


2) If your setup is static (like on a server, for example), you can edit /etc/resolv.conf manually and put your nameserver(s) in it. The minimal syntax looks like this:

Code:
nameserver 8.8.8.8
Or:

Code:
nameserver 8.8.8.8
nameserver 4.4.4.4
On my office server (running it's own DNS server), here's how things are configured:

Code:
[root@nestor:~] # cat /etc/resolv.conf 
# /etc/resolv.conf
domain microlinux.montpezat
search microlinux.montpezat
nameserver 127.0.0.1
Hope that helps,

Niki
thank you for explanation
 
Old 02-20-2013, 10:35 PM   #11
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
Quote:
$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.1
NetworkManager has set the DNS name server to point to 192.168.1.1. This is probably a modem/router. When your modem/router connects to the internet, it will be supplied DNS name server IPs. You will need to query your modem/router settings (probably via a web interface; in a browser try going to URL http://192.168.1.1) to find these addresses.

What happens is that when an address cannot be resolved locally (e.g. by an entry in /etc/hosts) then the DNS request is sent to the name server in /etc/resolv.conf. This request is then passed to the DNS name servers in your modem/router.

/edit Too slow!

Last edited by allend; 02-20-2013 at 10:36 PM.
 
Old 02-20-2013, 10:37 PM   #12
afreitascs
Member
 
Registered: Aug 2004
Distribution: Debian
Posts: 443

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by allend View Post
NetworkManager has set the DNS name server to point to 192.168.1.1. This is probably a modem/router. When your modem/router connects to the internet, it will be supplied DNS name server IPs. You will need to query your modem/router settings (probably via a web interface; in a browser try going to URL http://192.168.1.1) to find these addresses.

What happens is that when an address cannot be resolved locally (e.g. by an entry in /etc/hosts) then the DNS request is sent to the name server in /etc/resolv.conf. This request is then passed to the DNS name servers in your modem/router.

/edit Too slow!
is ... I understand

thanks
 
  


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
DNS: from command line? ashlesha Linux - General 2 07-26-2006 10:35 PM
Command to display DNS cache? frumpy93 Slackware 1 01-28-2006 05:11 PM
dig command questions DNS emailssent Linux - Networking 2 09-24-2004 09:27 AM
dig command questions DNS emailssent Linux - Networking 3 09-22-2004 05:56 AM
Command line DNS settings nateDiggsCSU Linux - Software 1 08-28-2004 04:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:37 AM.

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