Ask Question Forum:
Model Library:2025-02-08 Updated:A.I. model is online for auto reply question page
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by duncanb7
at 2024-07-25 08:21:03
Point:500 Replies:19 POST_ID:828610USER_ID:11059
Topic:
Apache Web Server;;Linux Networking
I go to /etc/resolv.conf, and just see there is only one line
like nameserver 8.8.8.8
So my VPS server will use 8.8.8.8 Google public DNS server as DNS , right ?
BEsides that, how can check or what linux comand to check my VPS server is already setup for DNS server or not ?
I have checked on whois , my VPS server 's nameserver is ns1.mysite.com and ns2.mysite.com and its IP is exactly same as the IP of my domain (www.mysite.com)
If ns1.mysite.com is nameserver, I should see it on the resolve.conf to record its
IP like nameserver 212.1.202.204 But there is not such thing besides nameserver 8.8.8.8
Please advise
Duncan
like nameserver 8.8.8.8
So my VPS server will use 8.8.8.8 Google public DNS server as DNS , right ?
BEsides that, how can check or what linux comand to check my VPS server is already setup for DNS server or not ?
I have checked on whois , my VPS server 's nameserver is ns1.mysite.com and ns2.mysite.com and its IP is exactly same as the IP of my domain (www.mysite.com)
If ns1.mysite.com is nameserver, I should see it on the resolve.conf to record its
IP like nameserver 212.1.202.204 But there is not such thing besides nameserver 8.8.8.8
Please advise
Duncan
Expert: skullnobrains replied at 2024-07-28 10:50:21
looks great. thanks again for posting back.
do you still have an issue there ?
looks like you did not allow external queries on other zones than your locally hosted one.
this should be workable by adapting the "internal" view which you probably do not need (do a copy-paste otherwise) by changing the "localnets" acl to the external ip of your seven machine (keeping "recursion yes" and the "vps.mysite.com" section)
best regards
do you still have an issue there ?
looks like you did not allow external queries on other zones than your locally hosted one.
this should be workable by adapting the "internal" view which you probably do not need (do a copy-paste otherwise) by changing the "localnets" acl to the external ip of your seven machine (keeping "recursion yes" and the "vps.mysite.com" section)
best regards
Author: duncanb7 replied at 2024-07-27 22:29:14
I set it for internal and external client to control access
if no nameserver 8.8.8.8 is found in resolv
it search other ISP/Public DNS recursively (so set it recursion yes for internal client)
named.conf
=======================
include "/etc/rndc.key";
controls {
inet 127.0.0.1 allow { localhost; } keys { "rndc-key"; };
};
options {
/* make named use port 53 for the source of all queries, to allow
* firewalls to block all ports except 53:
*/
// query-source port 53;
/* We no longer enable this by default as the dns posion exploit
has forced many providers to open up their firewalls a bit */
// Put files that named is allowed to write in the data/ directory:
directory "/var/named"; // the default
pid-file "/var/run/named/named.pid";
dump-file "data/cache_dump.db";
statistics-file "data/named_stats.txt";
/* memstatistics-file "data/named_mem_stats.txt"; */
allow-transfer {"none";};
};
logging {
/* If you want to enable debugging, eg. using the 'rndc trace' command,
* named will try to write the 'named.run' file in the $directory (/var/named").
* By default, SELinux policy does not allow named to modify the /var/named" directory,
* so put the default debug log file in data/ :
*/
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
// All BIND 9 zones are in a "view", which allow different zones to be served
// to different types of client addresses, and for options to be set for groups
// of zones.
//
// By default, if named.conf contains no "view" clauses, all zones are in the
// "default" view, which matches all clients.
//
// If named.conf contains any "view" clause, then all zones MUST be in a view;
// so it is recommended to start off using views to avoid having to restructure
// your configuration files in the future.
view "localhost_resolver" {
/* This view sets up named to be a localhost resolver ( caching only nameserver ).
* If all you want is a caching-only nameserver, then you need only define this view:
*/
match-clients { 127.0.0.0/24; };
match-destinations { localhost; };
recursion yes;
zone "." IN {
type hint;
file "/var/named/named.ca";
};
/* these are zones that contain definitions for all the localhost
* names and addresses, as recommended in RFC1912 - these names should
* ONLY be served to localhost clients:
*/
include "/var/named/named.rfc1912.zones";
};
view "internal" {
/* This view will contain zones you want to serve only to "internal" clients
that connect via your directly attached LAN interfaces - "localnets" .
*/
match-clients { localnets; };
match-destinations { localnets; };
recursion yes;
zone "." IN {
type hint;
file "/var/named/named.ca";
};
// include "/var/named/named.rfc1912.zones";
// you should not serve your rfc1912 names to non-localhost clients.
// These are your "authoritative" internal zones, and would probably
// also be included in the "localhost_resolver" view above :
zone "vps.mysite.com" {
type master;
file "/var/named/vps.mysite.com.db";
};
zone "mysite.com" {
type master;
file "/var/named/mysite.com.db";
};
};
view "external" {
/* This view will contain zones you want to serve only to "external" clients
* that have addresses that are not on your directly attached LAN interface subnets:
*/
recursion no;
// you'd probably want to deny recursion to external clients, so you don't
// end up providing free DNS service to all takers
// all views must contain the root hints zone:
zone "." IN {
type hint;
file "/var/named/named.ca";
};
// These are your "authoritative" external zones, and would probably
// contain entries for just your web and mail servers:
// BEGIN external zone entries
zone "vps.mysite.com" {
type master;
file "/var/named/vps.mysite.com.db";
};
zone "mysite.com" {
type master;
file "/var/named/mysite.com.db";
};
};
if no nameserver 8.8.8.8 is found in resolv
it search other ISP/Public DNS recursively (so set it recursion yes for internal client)
named.conf
=======================
include "/etc/rndc.key";
controls {
inet 127.0.0.1 allow { localhost; } keys { "rndc-key"; };
};
options {
/* make named use port 53 for the source of all queries, to allow
* firewalls to block all ports except 53:
*/
// query-source port 53;
/* We no longer enable this by default as the dns posion exploit
has forced many providers to open up their firewalls a bit */
// Put files that named is allowed to write in the data/ directory:
directory "/var/named"; // the default
pid-file "/var/run/named/named.pid";
dump-file "data/cache_dump.db";
statistics-file "data/named_stats.txt";
/* memstatistics-file "data/named_mem_stats.txt"; */
allow-transfer {"none";};
};
logging {
/* If you want to enable debugging, eg. using the 'rndc trace' command,
* named will try to write the 'named.run' file in the $directory (/var/named").
* By default, SELinux policy does not allow named to modify the /var/named" directory,
* so put the default debug log file in data/ :
*/
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
// All BIND 9 zones are in a "view", which allow different zones to be served
// to different types of client addresses, and for options to be set for groups
// of zones.
//
// By default, if named.conf contains no "view" clauses, all zones are in the
// "default" view, which matches all clients.
//
// If named.conf contains any "view" clause, then all zones MUST be in a view;
// so it is recommended to start off using views to avoid having to restructure
// your configuration files in the future.
view "localhost_resolver" {
/* This view sets up named to be a localhost resolver ( caching only nameserver ).
* If all you want is a caching-only nameserver, then you need only define this view:
*/
match-clients { 127.0.0.0/24; };
match-destinations { localhost; };
recursion yes;
zone "." IN {
type hint;
file "/var/named/named.ca";
};
/* these are zones that contain definitions for all the localhost
* names and addresses, as recommended in RFC1912 - these names should
* ONLY be served to localhost clients:
*/
include "/var/named/named.rfc1912.zones";
};
view "internal" {
/* This view will contain zones you want to serve only to "internal" clients
that connect via your directly attached LAN interfaces - "localnets" .
*/
match-clients { localnets; };
match-destinations { localnets; };
recursion yes;
zone "." IN {
type hint;
file "/var/named/named.ca";
};
// include "/var/named/named.rfc1912.zones";
// you should not serve your rfc1912 names to non-localhost clients.
// These are your "authoritative" internal zones, and would probably
// also be included in the "localhost_resolver" view above :
zone "vps.mysite.com" {
type master;
file "/var/named/vps.mysite.com.db";
};
zone "mysite.com" {
type master;
file "/var/named/mysite.com.db";
};
};
view "external" {
/* This view will contain zones you want to serve only to "external" clients
* that have addresses that are not on your directly attached LAN interface subnets:
*/
recursion no;
// you'd probably want to deny recursion to external clients, so you don't
// end up providing free DNS service to all takers
// all views must contain the root hints zone:
zone "." IN {
type hint;
file "/var/named/named.ca";
};
// These are your "authoritative" external zones, and would probably
// contain entries for just your web and mail servers:
// BEGIN external zone entries
zone "vps.mysite.com" {
type master;
file "/var/named/vps.mysite.com.db";
};
zone "mysite.com" {
type master;
file "/var/named/mysite.com.db";
};
};
Expert: skullnobrains replied at 2024-07-27 15:21:15
sorry, looks like my bind knowlege is a bit old, and i mixed up some parameter names.
http://www.zytrax.com/books/dns/ch7/queries.html#allow-recursion
recursion yes
allow-recursion { w.x.y.z; };
should be what you need in order to allow your seven host to issue query on the server
thanks for posting back
best regards
http://www.zytrax.com/books/dns/ch7/queries.html#allow-recursion
recursion yes
allow-recursion { w.x.y.z; };
should be what you need in order to allow your seven host to issue query on the server
thanks for posting back
best regards
Author: duncanb7 replied at 2024-07-27 12:43:39
recursion yes in named.conf
domine name resolve-->Local DNS---> ISP/public DNS
recursion no in named.conf
domain name resolve->Local DNS only
THanks for your reply and talk you later
domine name resolve-->Local DNS---> ISP/public DNS
recursion no in named.conf
domain name resolve->Local DNS only
THanks for your reply and talk you later
Expert: skullnobrains replied at 2024-07-27 12:19:33
sorry about the part regarding 127.0.0.1
most likely we cross-posted, (or i'm blind-enough to have missed your post)
most likely we cross-posted, (or i'm blind-enough to have missed your post)
Expert: skullnobrains replied at 2024-07-27 12:11:25
listen-on port 53 { 127.0.0.1; };
you'll definitively need to instruct bind to listen to another address or configure NAT rules in the local firewall if you expect the server to answer to remote queries. you'll also need to setup proper acls. refer to the link i posted in order to do so, the explanations are better than what i'd be able to give, and it is short.
Now the those setting of nameserver 8.8.8.8 in resolv.conf and "recusion yes" in named.conf prove my server is using forwardering mode for DNS server from Google
public DNS server(8.8.8.8) that can be verfied when I delete 8.8.8.8 in resolv.conf,
so tht nslookup yahoo.com 127.0.0.1 is not working, and nslookup is working only for
those internal network site which is specified domain name in named.conf for zone file
actually what tells your server to forward queries to another server are the "forward" and "forwarders" options. i did not enven know bind could use stuff from resolv.conf (but that was a long-awaited feature, thanks for posting back). i'll assume that bind acts in this way when you do not define any forwarders and the forward option is on.
note that bind is a full-blown dns server that knows how to resolve queries recursively by itself when it is configured to do so (allow recursion, define the root "." zone and download a recent hints file from iana)
external client is prohibited by setting "recursion no" in the file
no. as far as i remember this setting enables the full-blown resolver i'm talking about above.
like you said, external client access requires that you make your bind listen on your wan address instead of localhost, and also add either ACLs in bind or firewall rules so you do not leave an open dns to the world.
--
happy to see you're getting into it.
if you do not understand what i mean by "full-blown recursive resolver" either google it or ask in this thread, understanding this will also answer to other questions you posted.
Author: duncanb7 replied at 2024-07-27 11:56:17
For my memo only
=====================
for this recent about DNS server tutorial thread, also help me to
find how to create infinite subdomain for my server such as mmm.mysite.com or
yyy.mysite.com , and the explaination is defined clearly at
http://freelinuxtutorials.com/quick-tips-and-tricks/automatic-unlimited-subdomains-via-apache-mod_rewrite/
And I tested it for my server, all subdomain is working.
=====================
for this recent about DNS server tutorial thread, also help me to
find how to create infinite subdomain for my server such as mmm.mysite.com or
yyy.mysite.com , and the explaination is defined clearly at
http://freelinuxtutorials.com/quick-tips-and-tricks/automatic-unlimited-subdomains-via-apache-mod_rewrite/
And I tested it for my server, all subdomain is working.
Author: duncanb7 replied at 2024-07-27 11:51:34
Be clarify ,There is no such statments as follows on my named.conf file
allow-query { localhost; };
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
dnssec-enable yes;
dnssec-validation yes;
allow-query { localhost; };
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
dnssec-enable yes;
dnssec-validation yes;
Author: duncanb7 replied at 2024-07-27 11:49:40
Thanks for all of your reply
Now it is much better to understanding DNS, namserver, zone file
Duncan
Now it is much better to understanding DNS, namserver, zone file
Duncan
Author: duncanb7 replied at 2024-07-27 11:38:10
I agree skullnobrain, and
I found my named.conf file, there is no such statement to listen port 53 by localhost
allow-query { localhost; };
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
dnssec-enable yes;
dnssec-validation yes;
DNS server software is installed most likely but the configuration in /etc/named.config will
determine whether my server is internal or public DNS server.
Now the those setting of nameserver 8.8.8.8 in resolv.conf and "recusion yes" in named.conf prove my server is using forwardering mode for DNS server from Google
public DNS server(8.8.8.8) that can be verfied when I delete 8.8.8.8 in resolv.conf,
so tht nslookup yahoo.com 127.0.0.1 is not working, and nslookup is working only for
those internal network site which is specified domain name in named.conf for zone file
Those configuration in named.conf show my server is working as nameserver/DNS server for internal network or internal client only
and external client is prohibited by setting "recursion no" in the file and there is no
zone file for external client domain request besides localhost or mysite.com zone file
So no wonder why mysite.com, domain name IP can be the same as the my nameserver IP from information by http://www.intodns.com
domain: mysite.com(212.1.210.209)
namserver: ns1.mysite.com(212.1.210.209)
namserver: ns2.mysite.com(212.1.210.209)
Duncan
I found my named.conf file, there is no such statement to listen port 53 by localhost
allow-query { localhost; };
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
dnssec-enable yes;
dnssec-validation yes;
DNS server software is installed most likely but the configuration in /etc/named.config will
determine whether my server is internal or public DNS server.
Now the those setting of nameserver 8.8.8.8 in resolv.conf and "recusion yes" in named.conf prove my server is using forwardering mode for DNS server from Google
public DNS server(8.8.8.8) that can be verfied when I delete 8.8.8.8 in resolv.conf,
so tht nslookup yahoo.com 127.0.0.1 is not working, and nslookup is working only for
those internal network site which is specified domain name in named.conf for zone file
Those configuration in named.conf show my server is working as nameserver/DNS server for internal network or internal client only
and external client is prohibited by setting "recursion no" in the file and there is no
zone file for external client domain request besides localhost or mysite.com zone file
So no wonder why mysite.com, domain name IP can be the same as the my nameserver IP from information by http://www.intodns.com
domain: mysite.com(212.1.210.209)
namserver: ns1.mysite.com(212.1.210.209)
namserver: ns2.mysite.com(212.1.210.209)
Duncan
Assisted Solution
Expert: skullnobrains replied at 2024-07-27 09:52:03
100 points EXCELLENT
@duncan_roe : i don't want a big argument on the matter, but this is not quite true. it is the default for bind and dnsmasq on many linux flavors. it was not the default in bind last time i compiled one from source, it is still not the default in maradns, it became the default quite recently in powerdns... also some servers will handle restrictions in hosts.deny, tcp port 53 is often restricted on firewalls (many are shipped with pre-built services for dns/axfr on udp/tcp), and currently virtually no client use tcp as the default. there is also much to say on the usefullness of tcp-based DNS when you're not doing dnssec or zone transfers, and many reasons NOT to implement tcp when you host a zone... anyway, if you want to discuss that part, i'll be happy to do so in a private thread.
Expert: Duncan Roe replied at 2024-07-27 04:36:55
The default is for DNS to have TCP & UDP. You have to do something special to change that. I was assuming the target of interest has just a basic config
Assisted Solution
Expert: skullnobrains replied at 2024-07-27 03:56:29
100 points EXCELLENT
this means your name server is running and it does not allow queries from localhost
have a look at the "acl-clients" and the "allow-query" in the first section on the sample config file here : http://www.telecom.otago.ac.nz/tele301/student_html/named-conffile.html
this is how you allow remote clients. you'll need to allow 127.0.0.1 and the WAN ip of your seven host
----
the answer is in dig's output. it tells you which server gave the answer. use it verbosely if you want details.
as far as i know, dig will use each server in the resolv.conf file but will perform most of the recursion work itself and possibly do all the work starting from the root servers depending on the option it is given.
unless you have deep dns knowlege, you had better debug with host or nslookup and explicitely give them the server name so you know what happens for sure.
have a look at the "acl-clients" and the "allow-query" in the first section on the sample config file here : http://www.telecom.otago.ac.nz/tele301/student_html/named-conffile.html
this is how you allow remote clients. you'll need to allow 127.0.0.1 and the WAN ip of your seven host
----
the answer is in dig's output. it tells you which server gave the answer. use it verbosely if you want details.
as far as i know, dig will use each server in the resolv.conf file but will perform most of the recursion work itself and possibly do all the work starting from the root servers depending on the option it is given.
unless you have deep dns knowlege, you had better debug with host or nslookup and explicitely give them the server name so you know what happens for sure.
Author: duncanb7 replied at 2024-07-27 03:42:44
$ host google.com 127.0.0.1
Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:
Host google.com not found: 5(REFUSED)
I got the similar thing you have
but why I can dig goolge.com for its IP ? the answer might be the nameserver 8.8.8.8 in resolv.conf file , Right ?
Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:
Host google.com not found: 5(REFUSED)
I got the similar thing you have
but why I can dig goolge.com for its IP ? the answer might be the nameserver 8.8.8.8 in resolv.conf file , Right ?
Assisted Solution
Expert: skullnobrains replied at 2024-07-27 03:18:45
100 points EXCELLENT
@duncan : telnet connects over TCP, meaning it will connect successfully to any tcp-enabled DNS server. many DNS servers only work over UDP so your telnet can easily be unsuccessfull on a machine that has a dns server.
you can have a much better debug by sending an actual DNS query
you can have a much better debug by sending an actual DNS query
$ host google.com 127.0.0.1Using domain server:Name: 127.0.0.1Address: 127.0.0.1#53Aliases:Host google.com not found: 5(REFUSED) 1:2:3:4:5:6:7:
in this example, there is a dns server, but it is no configured as a forwarder for localhost (and it is actually not configured at all)
Assisted Solution
Expert: Duncan Roe replied at 2024-07-27 00:58:09
100 points EXCELLENT
If your VPS server is set up for DNS, it will be listening on port 53. So if you telnet to port 53 on that server and it connects, there is DNS there. For instance, in my network dullstar is a DNS server but dimstar is not
11:21:03$ telnet dullstar 53Trying 10.255.255.3...Connected to dullstar.Escape character is '^]'.^]telnet> qConnection closed.17:50:48$ telnet dimstar 53Trying 10.255.255.1...telnet: connect to address 10.255.255.1: Connection refused17:51:42$ 1:2:3:4:5:6:7:8:9:10:11:
When telnet connects, use the escape character that telnet advertized on connection to get to telnet's command line and close the connection.
The presence of a DNS does not guarantee that it is configured correctly.
The presence of a DNS does not guarantee that it is configured correctly.
Expert: noci replied at 2024-07-26 14:25:18
Nslookup also takes a hostfile in consideration. dig is a pure dns query t9ol.
Accepted Solution
Expert: skullnobrains replied at 2024-07-26 08:43:41
100 points EXCELLENT
So my VPS server will use 8.8.8.8 Google public DNS server as DNS , right ?
right : when you query the dns using the system's resolver, it will use 8.8.8.8 (and probably the hosts file as well). this is unrelated to working as a DNS server
BEsides that, how can check or what linux comand to check my VPS server is already setup for DNS server or not ?
check if a local dns server is running by using something like "nslookup whatever.com. 127.0.0.1". if you have any kind of answer other than timeout, you have a dns server running locally. then it does not mean it will be properly configured.
if it answers to generic queries such as google.com, it is properly configured as a forwarder.
if you want to host a zone, you'll have to dig in a little deeper, and post more information including which dns server is installed.
if you do not have a server yet, for a simple setup, it will be MUCH easier to get started with dnsmasq than bind
I have checked on whois , my VPS server 's nameserver is ns1.mysite.com and ns2.mysite.com and its IP is exactly same as the IP of my domain (www.mysite.com)
the whois information is not really meaningfull to your situation
what will make it work is if the parent domain answers to an NS query for your zone with the ip of your vps server.
If ns1.mysite.com is nameserver, I should see it on the resolve.conf to record its
IP like nameserver 212.1.202.204 But there is not such thing besides nameserver 8.8.8.8
IP like nameserver 212.1.202.204 But there is not such thing besides nameserver 8.8.8.8
no the client and server settings are unrelated. you can host a local dns server and use a different one. once your server works, if it is configured as a forwarder, you can add localhost to your resolve.conf in order to benefit of it's cache
Expert: noci replied at 2024-07-26 02:05:29
You confire your resolv.conf a dns server wont touch it.
Several dns servers do exist the most common one is bind.
Install its package and complete its configuration for your domain.
Use dig to verify how it functions and then update resolv.conf yourself. If you also allow localhost in your serverconfig then resolv.conf shoul refer to 127.0.0.1
Several dns servers do exist the most common one is bind.
Install its package and complete its configuration for your domain.
Use dig to verify how it functions and then update resolv.conf yourself. If you also allow localhost in your serverconfig then resolv.conf shoul refer to 127.0.0.1