Quick Block/Allow Feature - Manual Testing Guide
Overview
This guide provides step-by-step instructions for manually testing the Quick Block/Allow feature in CodexDNS.
Prerequisites
1. Start CodexDNS Server
.\bin\codexdns.exe
2. Login to Web UI
- Open browser:
http://localhost:8080 - Login with admin credentials
- Verify you see the dashboard
3. Generate DNS Traffic
To test the feature, you need live DNS queries. Options:
Option A: Use your own DNS queries
# Configure your system to use CodexDNS as DNS server
# Windows: Set DNS to 127.0.0.1 in network adapter settings
Option B: Use nslookup for testing
nslookup example.com 127.0.0.1
nslookup google.com 127.0.0.1
nslookup test.com 127.0.0.1
Option C: Use dig (if installed)
dig @127.0.0.1 example.com
Test Cases
TEST 1: Verify Pages Load โ
Steps:
Navigate to Filtering โ Live Queries in sidebar
Verify page loads with streaming DNS queries
Verify table has 10 columns including “Actions” as the last column
Verify each query row has 4 action buttons:
- ๐ก๏ธ Block Domain (shield-slash icon)
- โ Allow Domain (shield-check icon)
- ๐ซ Block Client (shield-slash icon)
- โ Allow Client (shield-check icon)
Navigate to Filtering โ Quick Rules in sidebar
Verify page loads with 4 tabs:
- Blocked Domains
- Allowed Domains
- Blocked Clients
- Allowed Clients
Verify empty states appear (search icons with messages)
Expected Result:
- Both pages load without errors
- All UI elements appear correctly
- No JavaScript console errors
TEST 2: Quick Block Domain โก
Steps:
- Go to Live Queries page
- Wait for a DNS query to appear (or generate one with
nslookup example.com 127.0.0.1) - Click the ๐ก๏ธ Block Domain button for
example.com - Verify confirmation dialog appears:
- Title: “Block Domain”
- Message: “Block all queries for example.com?”
- Buttons: Cancel, Block
- Click Block button
- Verify success notification/toast appears
- Navigate to Quick Rules โ Blocked Domains tab
- Verify
example.comappears in the list - Perform DNS query:
nslookup example.com 127.0.0.1
Expected Result:
- Confirmation dialog appears with correct domain name
- Success message after blocking
- Domain appears in Quick Rules โ Blocked Domains
- DNS query for
example.comreturns blocked response (NXDOMAIN or configured block IP)
Database Verification:
# Run automated test script
.\scripts\test-quick-rules.ps1
Look for example.com in TEST 6 output (Quick Block Rules).
TEST 3: Quick Allow Domain โก
Prerequisites:
- Have a domain that’s normally blocked by a blocklist (or use Quick Block to block one first)
Steps:
- Quick Block
test.com(follow TEST 2) - Verify
test.comqueries are blocked:nslookup test.com 127.0.0.1 - Go back to Live Queries page
- Generate query for
test.com:nslookup test.com 127.0.0.1 - Click โ
Allow Domain button for
test.com - Verify confirmation dialog:
- Title: “Allow Domain”
- Message: “Allow all queries for test.com?”
- Click Allow button
- Verify success notification
- Navigate to Quick Rules โ Allowed Domains tab
- Verify
test.comappears in the list - Perform DNS query:
nslookup test.com 127.0.0.1
Expected Result:
- Confirmation dialog shows domain name
- Success message appears
- Domain appears in Quick Rules โ Allowed Domains
- DNS query for
test.comnow resolves normally (allowlist overrides blocklist) - This verifies two-pass evaluation: Allow lists checked first!
TEST 4: Quick Block Client ๐ซ
Steps:
- Go to Live Queries page
- Note a client IP making queries (e.g.,
192.168.1.100) - Click ๐ซ Block Client button for that IP
- Verify confirmation dialog shows:
- Title: “Block Client”
- Message: “Block all queries from 192.168.1.100 (hostname)?”
- Click Block button
- Verify success notification
- Navigate to Quick Rules โ Blocked Clients tab
- Verify client appears with IP address displayed
- From that client IP, try any DNS query:
nslookup google.com
Expected Result:
- Confirmation shows IP and hostname
- Success message appears
- Client IP appears in Quick Rules โ Blocked Clients
- ALL DNS queries from that client are now blocked (regardless of domain)
Database Verification:
Check TEST 8 output for client-based rules with pattern __client:192.168.1.100__
TEST 5: Quick Allow Client โ
Prerequisites:
- Client must be blocked first (from TEST 4)
Steps:
- Verify client
192.168.1.100is blocked (queries fail) - Go to Live Queries page
- Generate query from blocked client
- Click โ Allow Client button for
192.168.1.100 - Verify confirmation dialog:
- Title: “Allow Client”
- Message: “Allow all queries from 192.168.1.100?”
- Click Allow button
- Verify success notification
- Navigate to Quick Rules โ Allowed Clients tab
- Verify client appears in the list
- From client, perform DNS query:
nslookup google.com
Expected Result:
- Confirmation shows client info
- Success message appears
- Client appears in Quick Rules โ Allowed Clients
- DNS queries from client now resolve normally (allowlist overrides blocklist)
TEST 6: Delete Rules ๐๏ธ
Steps:
- Go to Quick Rules page
- Switch to Blocked Domains tab
- Find a blocked domain (e.g.,
example.comfrom TEST 2) - Click Delete button (trash icon)
- Verify confirmation dialog:
- Title: “Delete Rule”
- Message shows domain/client pattern
- Click Confirm button
- Verify rule disappears from list
- If no more rules, verify empty state appears
- Perform DNS query for deleted domain:
nslookup example.com 127.0.0.1 - Repeat for other tabs (Allowed Domains, Blocked/Allowed Clients)
Expected Result:
- Confirmation dialog before deletion
- Rule disappears after confirmation
- Empty state appears when no rules remain
- Deleted rule no longer has effect (blocked domain now resolves, allowed domain can be blocked by other lists)
TEST 7: Two-Pass Evaluation Logic ๐ฏ
This is the most important test - verifies allowlist precedence!
Steps:
- Quick Block
precedence-test.com(TEST 2 steps) - Verify it’s blocked:
nslookup precedence-test.com 127.0.0.1- Expected: NXDOMAIN or block response
- Quick Allow same domain
precedence-test.com(TEST 3 steps) - Verify it now resolves:
nslookup precedence-test.com 127.0.0.1- Expected: Normal resolution (allowlist wins!)
- Navigate to Quick Rules page
- Verify domain appears in BOTH:
- Blocked Domains tab
- Allowed Domains tab
- Go to Allowed Domains tab
- Delete the allow rule for
precedence-test.com - Verify it’s blocked again:
nslookup precedence-test.com 127.0.0.1- Expected: NXDOMAIN or block response (blocklist now applies)
Expected Result:
- Step 2: Domain is blocked (blocklist active)
- Step 4: Same domain now resolves (allowlist overrides blocklist)
- Step 9: After deleting allow rule, domain is blocked again (blocklist applies)
- This proves: Allowlist โ Blocklist โ Default Allow evaluation order!
TEST 8: UI/UX Validation ๐จ
Steps:
- Verify action button icons are correct:
- Block Domain: shield with slash
- Allow Domain: shield with checkmark
- Block Client: shield with slash
- Allow Client: shield with checkmark
- Test confirmation dialogs:
- Clear titles
- Descriptive messages showing domain/IP
- Cancel and action buttons
- Verify success/error notifications:
- Success: green toast/banner
- Errors: red toast/banner with helpful message
- Test Quick Rules page tabs:
- Click each tab, verify content switches
- Active tab is highlighted
- Test empty states:
- Clear icons and messages
- Helpful instructions (e.g., “Use Quick Block button…”)
- Test delete confirmations:
- Dialog before deletion
- Shows what will be deleted
- Test responsive design:
- Resize browser window
- Test on mobile viewport (F12 โ mobile view)
- Verify tables scroll horizontally if needed
Expected Result:
- All icons display correctly
- Dialogs are clear and informative
- Notifications provide feedback
- Tabs switch smoothly
- Empty states are helpful
- UI works on mobile and desktop
TEST 9: Error Handling โ ๏ธ
Steps:
- Duplicate Block: Block same domain twice
- Block
duplicate.com - Try to block
duplicate.comagain - Expected: Success (idempotent) or friendly message
- Block
- Duplicate Allow: Allow same domain twice
- Allow
test.com - Try to allow
test.comagain - Expected: Success (idempotent) or friendly message
- Allow
- Invalid Domain (if validation exists):
- Try patterns like
invalid..domain,@#$% - Expected: Validation error or graceful handling
- Try patterns like
- Invalid IP (if validation exists):
- Try IPs like
999.999.999.999,not-an-ip - Expected: Validation error or graceful handling
- Try IPs like
- Check browser console (F12):
- Look for JavaScript errors
- Should be clean (no red errors)
- Check server logs:
- Look for unexpected errors or stack traces
- Normal operation should log actions only
Expected Result:
- Duplicate operations handled gracefully (no crashes)
- Invalid inputs rejected with friendly messages
- No JavaScript console errors
- Server logs show only expected messages
TEST 10: Database Verification ๐
Run Automated Test Script:
.\scripts\test-quick-rules.ps1
Manual Database Checks:
Check Quick Lists:
SELECT id, name, is_custom, created_at
FROM filter_lists
WHERE name IN ('__Quick_Block_List__', '__Quick_Allow_List__');
Expected:
- Both lists exist
is_custom = 1(true)
Check Quick Rules:
SELECT fr.id, fr.pattern, fr.rule_type, fl.name
FROM filter_rules fr
JOIN filter_lists fl ON fl.id = fr.list_id
WHERE fl.name IN ('__Quick_Block_List__', '__Quick_Allow_List__');
Expected:
- All quick blocked/allowed domains appear
- Client rules have pattern
__client:<ip>__
Check Policies:
SELECT fp.id, fp.group_id, fp.list_id, fl.name
FROM filter_policies fp
JOIN filter_lists fl ON fl.id = fp.list_id
WHERE fp.group_id = 1
AND fl.name IN ('__Quick_Block_List__', '__Quick_Allow_List__');
Expected:
- Policies exist for Quick Lists
group_id = 1(All Clients group)
Check All Clients Group:
SELECT id, name, description FROM client_groups WHERE id = 1;
Expected:
- Group exists with ID = 1
- Name = “All Clients”
Quick Test Matrix
| Test | Feature | Status | Notes |
|---|---|---|---|
| 1 | Pages Load | โ | Live Queries + Quick Rules UI |
| 2 | Block Domain | โ | Blocks DNS queries |
| 3 | Allow Domain | โ | Overrides blocklists |
| 4 | Block Client | โ | Blocks all client queries |
| 5 | Allow Client | โ | Overrides client blocks |
| 6 | Delete Rules | โ | Removes rules, restores default |
| 7 | Two-Pass Logic | โ | Allowlist โ Blocklist โ Default |
| 8 | UI/UX | โ | Icons, dialogs, responsive |
| 9 | Error Handling | โ | Duplicates, invalid inputs |
| 10 | Database | โ | Run automated script |
Test Data Cleanup
After testing, you may want to clean up test data:
-- Delete all Quick Block rules
DELETE FROM filter_rules
WHERE list_id IN (
SELECT id FROM filter_lists WHERE name = '__Quick_Block_List__'
);
-- Delete all Quick Allow rules
DELETE FROM filter_rules
WHERE list_id IN (
SELECT id FROM filter_lists WHERE name = '__Quick_Allow_List__'
);
-- Or delete the entire Quick Lists (will be recreated on next use)
DELETE FROM filter_policies
WHERE list_id IN (
SELECT id FROM filter_lists
WHERE name IN ('__Quick_Block_List__', '__Quick_Allow_List__')
);
DELETE FROM filter_lists
WHERE name IN ('__Quick_Block_List__', '__Quick_Allow_List__');
Troubleshooting
Issue: Buttons don’t appear on Live Queries page
- Check: Browser console for JavaScript errors
- Check: Template file
querystream.templhas Actions column - Fix: Clear browser cache, restart server
Issue: Rules don’t block/allow as expected
- Check: Database verification (TEST 10)
- Check: Server logs for filter evaluation
- Debug: Run
.\scripts\test-quick-rules.ps1to verify DB state
Issue: Confirmation dialogs don’t appear
- Check: Browser JavaScript console
- Check: Alpine.js is loaded (network tab)
- Fix: Hard refresh browser (Ctrl+F5)
Issue: Empty states don’t disappear after adding rules
- Check: Browser console for errors
- Fix: Refresh page or check Alpine.js state
Success Criteria
โ
All 10 tests pass
โ
No JavaScript console errors
โ
No unexpected server errors
โ
Database state matches UI state
โ
Two-pass evaluation works correctly
โ
UI is responsive and user-friendly
Reporting Issues
If you find bugs, document:
- Test case that failed
- Steps to reproduce
- Expected vs actual result
- Browser console errors (F12)
- Server logs (relevant excerpts)
- Database state (run automated script)
- Screenshots (if applicable)